Blog

python tutorials and learn python

Created with Sketch.

NumPy ravel()

NumPy ravel() Summary: in this tutorial, you’ll learn how to use the NumPy ravel() to return a contiguous flattened array. Introduction to the NumPy ravel() function The ravel() function accepts an array and returns a 1-D array containing the elements of the input array: numpy.ravel(a, order=’C’)   In this syntax: a is a numpy array.…
Read more

NumPy flatten()

NumPy flatten() Summary: in this tutorial, you’ll learn how to use the numpy flatten() method to return a copy of an array collapsed into one dimension. Introduction to the NumPy flatten() method The flatten() is a method of the ndarray class. The flatten() method returns a copy of an array collapsed into one dimension. The…
Read more

NumPy sort()

NumPy sort() Summary: in this tutorial, you’ll learn how to use the numpy sort() function to sort elements of an array. Introduction to the NumPy sort() function The sort() function returns a sorted copy of an array. Here’s the syntax of the sort() function: numpy.sort(a, axis=- 1, kind=None, order=None)   In this syntax: a is…
Read more

NumPy transpose()

NumPy transpose() Summary: in this tutorial, you’ll learn how to use the numpy transpose() function to reverse the axes of an array. Introduction to the numpy transpose() function The numpy transpose() function reverses the axes of an array. Here’s the syntax of the transpose() function: numpy.transpose(a, axes=None) Code language: Python (python) In this syntax: a…
Read more

NumPy reshape()

NumPy reshape() Summary: in this tutorial, you’ll learn how to use the numpy reshape() function to change the shape of an array. Introduction to the numpy reshape() function A shape of an array stores the number of dimensions (or axes) and the number of elements on each dimension. The shape property returns a tuple that…
Read more

NumPy any()

NumPy any() Summary: in this tutorial, you’ll learn how to use the numpy any() function that returns True if any element in an array evaluates True. Introduction to the numpy any() function The numpy any() function returns True if any element in an array (or along a given axis) evaluates to True. Here’s the syntax…
Read more

NumPy all()

NumPy all() Summary: in this tutorial, you’ll learn how to use the numpy all() function that returns True if all elements in an array evaluate True. Introduction to the numpy all() function The numpy all() function returns True if all elements in an array (or along a given axis) evaluate to True. The following shows…
Read more

NumPy amax()

NumPy amax() Summary: in this tutorial, you will learn how to use the numpy amax() function to find the maximum element in an array. Introduction to the NumPy amax() function The amax() function returns the maximum element of an array or maximum element along an axis. The following shows the syntax of the amax() function:…
Read more

NumPy amin()

NumPy amin() Summary: in this tutorial, you will learn how to use the numpy amin() function to find the minimum element in an array. Introduction to the NumPy amin() function The amin() function returns the minimum element of an array or minimum element along an axis. Here’s the syntax of the amin() function: numpy.amin(a, axis=None,…
Read more

NumPy prod()

NumPy prod() Summary: in this tutorial, you’ll learn how to use the numpy prod() function to calculate the product of numbers in an array. Introduction to to the NumPy prod() function Suppose you have three numbers n, m, and k. The product of the three numbers is nxmxk. For example, the product of 2, 3,…
Read more