Language Selection

English French German Italian Portuguese Spanish

Python Programming

Filed under
Development
  • How to Convert a Float Array to an Integer Array in Python with NumPy

    In this short NumPy tutorial, we are going to learn how to convert a float array to an integer array in Python. Specifically, here we are going to learn by example how to carry out this rather simple conversion task. First, we are going to change the data type from float to integer in a 1-dimensional array. Second, we are going to convert float to integer in a 2-dimensional array.
    Now, sometimes we may want to round the numbers before we change the data type. Thus, we are going through a couple of examples, as well, in which we 1) round the numbers with the round() method, 2) round the numbers to the nearest largest in with the ceil() method, 3) round the float numbers to the nearest smallest numbers with floor() method. Note, all code can be found in a Jupyter Notebook.

  • How to Find the Length of a List in Python

    Lists are one of the most commonly used data types in Python and are used to store collections of items of the same type.

  • Python Import Command

    The import command in Python is used to get access to other modules. Modules are the same as a code library in Java, C, C++, or C#. A module typically involves a set of functions and variables. When we need to include or use these functions of modules in our code, we can simply import the module by using the import command and we can easily invoke the module functions and variables. The import command is the simplest and common way of including modules into your code.

    Python comes up with many built-in modules that we can include in our code easily. We can also create our module by just saving the Python code file with the .py extension.

    In this article, we will learn that how we can import our own and built-in modules in Python. Spyder3 editor is used to creating and running the Python scripts.

  • Python List Index

    In this post, we will learn about how to index lists in Python.

    The index() method returns the index of an item in Python list.

  • Weekly Python StackOverflow Report: (ccxliii) stackoverflow python report

More in Tux Machines

Android Leftovers

Stereoscopic cam board taps Raspberry Pi CM4

StereoPi is going to Crowd Supply to pitch an open-spec “StereoPi v2” stereoscopic camera board that works with the Raspberry Pi CM4. The v2 adds a Type-C port and advances to GbE and 802.11ac. In Dec. 2019, Russia-based Virt2real found Crowd Supply success with a StereoPi stereoscopic camera board that works with the Raspberry Pi Compute Module 3 (CM3). Now operating under the StereoPi name, the company has posted a Crowd Supply page for a second-gen model that uses the new Raspberry Pi CM4. Read more

8 Tools to Easily Create a Custom Linux Distro

When there are so many Linux distros out there, you are probably wondering why someone would want to create their own distro instead of getting a readymade one. While in most cases a readymade distro is fine, if you want to have a distro that is 100 percent tailored to your needs (or your mum or dad’s needs), you may have to create your own custom Linux distro. With the right tools, creating your own Linux distro isn’t as hard as it seems, though it takes time for sure. There are many tools for the purpose – some of them are universal, and some of them are distro-specific. Here are eight of them. Read more

today's leftovers

  • 7 Halloween-themed Retro-Games for RetroPie - YouTube

    Halloween is my favorite holiday! And to celebrate, here are 7 great retro games that are perfect for the occasion. These are some great spooky-fun games to add to your RetroPie.

  • Friends of GNOME Update – October 2020

    We’re working with our friends at KDE on the Linux Application Summit (LAS). This event takes place November 12 – 14. It will be online this year. The event will cover all things to do with apps in a Linux environment. Registration is open! LAS is also looking for volunteers, so if you’d like to get involved, please fill out this form. Registration for GNOME.Asia is open! The GNOME.Asia Summit 2020 will be taking place online on November 24 – 26. While the conference is centered around the GNOME Project, there will be talks, workshops, and Birds of a Feather sessions for everyone interested in free and open source software. You can register online.

  • Collabora developers mentor successful GSoC Projects

    Autumn is just around the corner. For many participants in the GSoC 2020, a busy and instructive summer full of hacking on open source projects came to an end a few weeks ago. Commits have been contributed and final reports have been written. This year experienced Collabora Productivity developers were again mentors for various projects of the Google Summer of Code for the LibreOffice project. Here are some examples of projects our team helped to succeed!

  • OpenBehavior: A Rich Directory for Open-source Behavioral Neuroscience Projects

    OpenBehavior is an open-source repository for tools, software, projects and scripts that are dedicated for behavioral neuroscience research. The main goal is to promote and accelerate the collaboration of open-source neuroscience projects, neuroscience researchers and developers. Currently, OpenBehavior has 145 projects and active community of developers and research who are supporting this project. The project is founded and maintained by a group of researchers and professors. It started 2016 by Mark Lubach (PhD) and Alexxai Karvitz (PhD). The project is funded by NASA DC Space Grant Consortium to ML, Summer 2017. However, It's still looking for more support as it's 100% volunteer work.

  • Taskcluster's DB (Part 1) - Azure to Postgres [Ed: Mozilla flirtations with Microsoft again]

    This is a deep-dive into some of the implementation details of Taskcluster. Taskcluster is a platform for building continuous integration, continuous deployment, and software-release processes. It’s an open source project that began life at Mozilla, supporting the Firefox build, test, and release systems. The Taskcluster “services” are a collection of microservices that handle distinct tasks: the queue coordinates tasks; the worker-manager creates and manages workers to execute tasks; the auth service authenticates API requests; and so on.

  • Open Source Drive-Thru Contributors [Ed: Openwashing agenda by VM Brasseur or how to 'farm' a community for 'free labour']

    VM Brasseur explains open source “drive-thru contributions” and explores how the process can be improved. In the ongoing efforts to create a sustainable free and open source software ecosystem—one where projects receive the attention they need without burning out their maintainers in the process—a lot of attention has justifiably fallen on increasing the number of FOSS contributors. Much of the discussion around increasing contributors assumes that the primary goal is to get contributors who will stick around and become community members and maintainers. It's certainly true that many hands make light work, and the more maintainers a project has the less likely it is that any one of them will bear the brunt of the work and burn out. But, this isn't the only way to support project sustainability through contributions. Another approach is to optimize your project for drive-thru contributors.

  • Security updates for Thursday

    Security updates have been issued by Debian (linux-4.19), Fedora (tcpreplay, xen, and yubihsm-shell), SUSE (pacemaker), and Ubuntu (gosa and pam-python).

  • Set up CUPS Print Server in Ubuntu 20.04 – Linux Hint

    The job of a print server is to accept print requests from multiple machines, process those requests, and then send them to the specified printer for serving those requests. CUPS is a utility designed for Linux operating systems that can turn a regular computer system into a print server. This article provides a method for setting up the CUPS print server in Ubuntu 20.04.

  • Ubuntu Unity Groovy Gorilla

    This tutorial explains how to switch Ubuntu 20.10 user interface back to Unity rather than GNOME. This is for computer users who prefer Ubuntu with its innovative Unity appearance that found in version 10.04 LTS and 16.10. Now let's have fun!