Learn to get NumPy array properties: size (element count), shape (dimensions), and nbytes (memory usage).
-
-
Learn three methods to convert Python lists to NumPy arrays: np.array(), np.asarray(), and np.concatenate() for different data structures.
-
Learn how to calculate matrix determinants using NumPy’s linalg.det() for linear algebra operations and matrix analysis.
-
Learn how to rotate, flip, and transpose NumPy matrices using rot90(), flip(), and transpose() methods.
-
Learn how to count zeros in NumPy arrays using count_nonzero(), sum(), where(), and other efficient methods.
-
Numpy offers different ways to create and empty arrays. Let’s learn how to empty an array in Numpy. We will use the Numpy empty method and a clever trick.
-
Learn how to save and load NumPy arrays as binary files using tofile(), savez(), and save() methods.
-
Learn how to normalize NumPy arrays using np.linalg.norm() for L2 normalization, Min-Max scaling, and standardization. Normalization scales numerical data to a standard range, often between 0 and 1 or to have a unit norm. This process is essential for algorithms sensitive to the scale of input features, such as gradient descent-based methods and distance-based algorithms.
-
Let’s learn how to permute in Numpy. We will use Python Numpy permutation method.
-
Learn how to display full NumPy arrays without truncation using np.set_printoptions() with threshold parameter.
-
Learn how to calculate frequency of distinct values in NumPy arrays using np.unique() with return_counts parameter.
-
Let’s check how many zeros there are in your array. We will use the Numpy count_nonzero function. Counting zero elements in arrays is used for tasks such as identifying missing data points (where zeros might represent null values) or analyzing data distributions where the presence of zeros is significant.
-
Learn how to check if NumPy arrays are empty using size attribute, shape property, and other validation methods.
-
Learn how to convert NumPy arrays to boolean dtype using astype() and other methods for logical operations and comparisons.
-
Learn how to shuffle NumPy arrays using np.random.shuffle() for randomizing element order in-place.