Category: New Python tutorial

python tutorials and learn python

Created with Sketch.

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

NumPy std()

NumPy std() Summary: in this tutorial, you’ll learn how to use the numpy std() function to calculate the standard deviation. Standard deviation measures how spread out the elements of an array is. The more spread out elements is, the greater their standard deviation. Standard deviation is the square root of the variance. To calculate the…
Read more

NumPy var()

NumPy var() Summary: in this tutorial, you’ll learn how to use the var() function to calculate the variances of elements in an array. Introduction to the NumPy var() function The variance is a measure of the spread of a distribution. To manually calculate the variance of numbers, you follow these steps: First, calculate the average…
Read more

NumPy mean()

NumPy mean() Summary: in this tutorial, you’ll learn how to use the numpy mean() function to calculate the average of elements of an array. Introduction to the NumPy mean() function The mean() function returns the average of elements in an array. Here’s the syntax of the mean() function: numpy.mean(a, axis=None, dtype=None, out=None, keepdims=<no value>, *,…
Read more

NumPy sum()

NumPy sum() Summary: in this tutorial, you’ll learn how to use the numpy sum() function to return the sum of all elements in an array. Introduction to the numpy sum() function The numpy sum() function is an aggregate function that takes an array and returns the sum of all elements. The following example uses the…
Read more