Python tutorials

Matplotlib Scatter Plot with Distribution Plots (Joint Plot) – Tutorial and Examples

Introduction There are many data visualization libraries in Python, yet Matplotlib is the most popular library out of all of them. Matplotlib’s popularity is due to its reliability and utility – it’s able to create both simple and complex plots with little code. You can also customize the plots in a variety of ways. In this tutorial, we’ll cover how to plot a Joint Plot in Matplotlib which consists of a Scatter Plot and multiple Distribution Plots on the same […]

Read more

Python Community Interview With Will McGugan

Today I’m joined by Will McGugan. Will is a freelance Python developer based in Scotland and the creator of the popular Python library Rich. In this interview, we discuss the origins of Rich, what it’s like to maintain a popular Python package, building chess engines, and Will’s love of photography. Ricky: Thanks for joining me for this interview, Will. I’d like to start in the same manner we do with all our guests: how did you get into programming, and […]

Read more

Matplotlib Stack Plot – Tutorial and Examples

Introduction There are many data visualization libraries in Python, yet Matplotlib is the most popular library out of all of them. Matplotlib’s popularity is due to its reliability and utility – it’s able to create both simple and complex plots with little code. You can also customize the plots in a variety of ways. In this tutorial, we’ll cover how to plot Stack Plots in Matplotlib. Stack Plots are used to plot linear data, in a vertical order, stacking each […]

Read more

Understanding Python List Comprehensions

One of Python’s most distinctive features is the list comprehension, which you can use to create powerful functionality within a single line of code. However, many developers struggle to fully leverage the more advanced features, or use them too much, which can lead to code that’s less efficient and harder to read. By the end of this course, you’ll understand the full power of Python list comprehensions and how to use their features comfortably. You’ll also gain an understanding of […]

Read more

OrderedDict vs dict in Python: The Right Tool for the Job

Sometimes you need a Python dictionary that remembers the order of its items. In the past, you had only one tool for solving this specific problem: Python’s OrderedDict. It’s a dictionary subclass specially designed to remember the order of items, which is defined by the insertion order of keys. This changed in Python 3.6. The built-in dict class now keeps its items ordered as well. Because of that, many in the Python community now wonder if OrderedDict is still useful. […]

Read more

How to Print Colored Text in Python

Introduction It’s typical for CLI apps to return text in the same color of the terminal. There are always cases when we want to highlight output to the user, for example, a warning or error message. In those cases, a dash of color could make a difference. This article shows you how to print colored output in the terminal in Python with and without libraries. ANSI Escape Sequences Your Teletypewriter (TTY), or rather your terminal, is not only capable of […]

Read more

Parse Datetime Strings with parsedatetime in Python

Introduction In this tutorial, we’ll take a look at how to parse Datetime with parsedatetime in Python. To use the parsedatetime package we first need to install it using pip: $ pip install parsedatetime Should pip install parsedatetime fail, the package is also opensource available on Github. Convert String to Python’s Datetime Object with parsedatetime The first, and most common way to use parsedatetime is to parse a string into a datetime object. First, you’ll want to import the parsedatetime […]

Read more

Python Community Interview With Dane Hillard

Today I’m joined by Dane Hillard, lead web application developer at ITHAKA and author of Practices of the Python Pro. Dane is also a Real Python tutorial author. In this interview, we discuss a variety of topics, including code complexity, Python package maintenance, and popcorn. So without further ado, let’s welcome Dane. Ricky: Thanks for joining me for this interview, Dane. I’d like to start in the same manner we do with all our guests: how did you get into programming, […]

Read more

Records and Sets: Selecting the Ideal Data Structure

There are a variety of ways for storing and managing data in your program and the choice of the right data structure has an effect on the readability of your code, ease of writing, and performance. Python has a wide selection of built-in mechanisms that meet most of your data structure needs. This course introduces you to two types of data structures: data records and sets. There are multiple types and classes for both of these data structures and this […]

Read more

Build an Asteroids Game With Python and Pygame

Do you want to create your own computer games but like Python too much to abandon it for a career as a game developer? There’s a solution for that! With the Pygame module, you can use your amazing Python skills to create games, from the basic to the very complex. Below, you’ll learn how to use Pygame by making a clone of the Asteroids game! In this tutorial, you’ll learn how to build a complete game, including: Loading images and […]

Read more
1 124 125 126 127 128 181