Python tutorials

How to Evaluate the Quality of Python Packages

Installing packages with Python is just one pip install command away. That’s one of the many great qualities that the Python ecosystem has to offer. However, you may have downloaded a third-party package once that didn’t work out for you in one way or another. For example, the package didn’t support the Python version that you were using in your project, or the package didn’t do what you expected it to do. By understanding the characteristics of a high-quality Python […]

Read more

Documenting Python Projects With Sphinx and Read the Docs

Sphinx is a document generation tool that’s become the de facto standard for Python projects. It uses the reStructuredText (RST) markup language to define document structure and styling, and it can output in a wide variety of formats, including HTML, ePub, man pages, and much more. Sphinx is extendable and has plugins for incorporating pydoc comments from your code into your docs and for using MyST Markdown instead of RST. Read the Docs is a free document hosting site where […]

Read more

Python News: What’s New From February 2023

February is the shortest month, but it brought no shortage of activity in the Python world! Exciting developments include a new company aiming to improve cloud services for developers, publication of the PyCon US 2023 schedule, and the first release candidate for pandas 2.0.0. In the world of artifical intelligence, OpenAI has continued to make strides. But while the Big Fix has worked to reduce vulnerabily for programmers, more malicious programs showed up on PyPI. Read on to dive into […]

Read more

Python’s Mutable vs Immutable Types: What’s the Difference?

Mutable data types are another face of the built-in types in Python. The language provides a few useful mutable collection types that you can use in many situations. These types allow you to change the value of specific items without affecting the identity of the container object. In the following sections, you’ll learn about lists, which are arguably the classic example of a mutable type in Python. To complete your tool kit of mutable types, you’ll learn about dictionaries and […]

Read more

Manipulating ZIP Files With Python

Python’s zipfile is a standard-library module intended to manipulate ZIP files. This file format is a widely adopted industry standard when it comes to archiving and compressing digital data. You can use it to package together several related files. It also allows you to reduce the size of your files and save disk space. Most importantly, it facilitates data exchange over computer networks. Knowing how to create, read, write, populate, extract, and list ZIP files using the zipfile module is […]

Read more

What’s a Python Namespace Package, and What’s It For?

Python namespace packages are an advanced Python feature. You may have heard them mentioned in relation to the __init__.py file. Specifically, if you don’t include at least an empty __init__.py file in your package, then your package becomes a namespace package. For the most part, namespace packages and regular packages won’t behave differently when it comes to using them in your project. In fact, you’ve probably accidentally forgotten to include an __init__.py file in at least one package but didn’t […]

Read more

Iterators and Iterables in Python: Run Efficient Iterations

Python’s iterators and iterables are two different but related tools that come in handy when you need to iterate over a data stream or container. Iterators power and control the iteration process, while iterables typically hold data that you want to iterate over one value at a time. Iterators and iterables are fundamental components of Python programming, and you’ll have to deal with them in almost all your programs. Learning how they work and how to create them is key […]

Read more

Writing Clean, Pythonic Code With namedtuple

Python’s collections module provides a factory function called namedtuple(), which is specially designed to make your code more Pythonic when you’re working with tuples. With namedtuple(), you can create immutable sequence types that allow you to access their values using descriptive field names and the dot notation instead of unclear integer indices. If you have some experience using Python, then you know that writing Pythonic code is a core skill for Python developers. In this video course, you’ll level up […]

Read more

Using NumPy reshape() to Change the Shape of an Array

The main data structure that you’ll use in NumPy is the N-dimensional array. An array can have one or more dimensions to structure your data. In some programs, you may need to change how you organize your data within a NumPy array. You can use NumPy’s reshape() to rearrange the data. The shape of an array describes the number of dimensions in the array and the length of each dimension. In this tutorial, you’ll learn how to change the shape […]

Read more

The Terminal: First Steps and Useful Commands

The terminal can be intimidating to work with when you’re used to working with graphical user interfaces (GUIs). However, it’s an important tool that you need to get used to in your journey as a Python developer. And once you level up your skill of using the terminal, it becomes an extremely powerful tool in your repertoire. With just a few commands in the terminal, you can do tasks that are impossible or at least very tedious to do in […]

Read more
1 50 51 52 53 54 189