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

How to use Numpy reshape

NumPy arrays are an important component of the Python data science ecosystem. When working with NumPy arrays, you’re going to need to be able to perform basic data manipulation. In particular, you may need to change the “shape” of the data; you may need to change how the data are arranged in the NumPy array. … Read more

R vs Python … which to learn for data science

One of the most common questions I get from data science hopefuls is “which programming language should I learn?” My general advice is “it depends.” Or to clarify my response, I like to ask the question “who are you, and what are your goals?” The programming language you use depends on your background and your … Read more