How to make a matplotlib histogram

This tutorial will explain how to make a matplotlib histogram. If you’re interested in data science and data visualization in Python, then read on. This post will explain how to make a histogram in Python using matplotlib. Here’s exactly what the tutorial will cover: A quick introduction to matplotlib The syntax for the matplotlib histogram … Read more

How to use the NumPy mean function

A visual representation of how NumPy mean computes the average of a NumPy array.

This tutorial will show you how to use the NumPy mean function, which you’ll often see in code as numpy.mean or np.mean. It will teach you how the NumPy mean function works at a high level and it will also show you some of the details. So, you’ll learn about the syntax of np.mean, including … Read more

How to use the NumPy concatenate function

This tutorial will explain how to use the NumPy concatenate function in Python (which is sometimes called np.concatenate). This post will cover several topics. If you don’t want to read the full tutorial, click on the appropriate link and it will send you to the relevant section of this tutorial. This post will cover: What … Read more

How to use the Numpy ones function

A visual representation of a 2x3 numpy array created with the NumPy ones function.

In this tutorial I’ll show you how to use the NumPy ones function, which is often called np.ones. What the numpy ones function does The NumPy ones function creates NumPy arrays filled with 1‘s. That’s it. It’s pretty straight forward. The np.ones function is also fairly easy to use. But, there are a few details … Read more

Numpy Axes, Explained

This tutorial will explain NumPy axes. It will explain what a NumPy axis is. The tutorial will also explain how axes work, and how we use them with NumPy functions. Although it’s probably best for you to read the full tutorial, if you want to skip ahead, you can do so by clicking on one … Read more

How to Use the Numpy Sum Function

This tutorial will show you how to use the NumPy sum function (sometimes called np.sum). In the tutorial, I’ll explain what the function does. I’ll also explain the syntax of the function step by step. Finally, I’ll show you some concrete examples so you can see exactly how np.sum works. Let’s jump in. NumPy sum … Read more

How to use the Numpy append function

This tutorial will show you how to use the NumPy append function (sometimes called np.append). Here, I’ll explain what the function does. I’ll explain the syntax (piece by piece), and I’ll show you some step-by-step examples so you can see exactly how np.append works. Let’s get to it. Numpy append appends values to an existing … Read more

How to Use the Numpy Linspace Function

A visual representation of the output of np.arange(start = 0, stop = 100, num = 5).

The NumPy linspace function (sometimes called np.linspace) is a tool in Python for creating numeric sequences. It’s somewhat similar to the NumPy arange function, in that it creates sequences of evenly spaced numbers structured as a NumPy array. There are some differences though. Moreover, some people find the linspace function to be a little tricky … Read more

How to Use the Numpy Arange Function

A NumPy array of floats from 1 to 4, made with np.arange.

The Numpy arange function (sometimes called np.arange) is a tool for creating numeric sequences in Python. If you’re learning data science in Python, the Numpy toolkit is important. The NumPy arange function is particularly important because it’s very common; you’ll see the np.arange function in a lot of data science code. Having said that, this … Read more