The Numpy Library

How to Print a NumPy Array Without Brackets in Python?

Note that this tutorial concerns NumPy arrays. To learn how to print lists without brackets check out this tutorial: How to Print a List Without Brackets in Python? Problem Formulation Given a NumPy array of elements. If you print the array to the shell using print(np.array([1, 2, 3])), the output is enclosed in square brackets …

How to Print a NumPy Array Without Brackets in Python? Read More »

People Who Bought X Also Bought …? An Introduction to NumPy Association Analysis

Imagine you are Jeff Bezos. One of the most successful features of your company Amazon is product recommendation. “People who bought X also bought Y.” Roughly speaking, this feature alone has made you billions. For you, Jeff Bezos, product recommendation is the most important algorithm in the world, isn’t it? In this article, you’ll learn …

People Who Bought X Also Bought …? An Introduction to NumPy Association Analysis Read More »

NumPy all() – A Simple Guide with Video

Syntax numpy.all(a, axis=None, out=None, keepdims=<no value>, *, where=<no value>) Argument Type Description a array_like Input array axis None, int, or tuple of int Optional. One axis or multiple axes along which logical AND should be performed. Per default, it computes logical AND on the flat array. If this is a tuple of integers, calculates logical …

NumPy all() – A Simple Guide with Video Read More »

How to Print the Full NumPy Array Without Truncation?

Problem Formulation In some shell environments, when printing a large NumPy array, the Python interpreter automatically displays only a small, truncated portion of the array, using the triple dots ‘…’ to indicate that some values are missing in the textual representation of the array. Here’s an example of a truncated array: Here’s how that looks …

How to Print the Full NumPy Array Without Truncation? Read More »

How to Find Outliers in NumPy Easily?

Can you spot the outliers in the following sequence: 000000001000000001? Detecting outliers fast can be mission critical for many applications in military, air transport, and energy production. This article shows you the most basic outlier detection algorithm: if an observed value deviates from the mean by more than the standard deviation, it is considered an …

How to Find Outliers in NumPy Easily? Read More »