In this python numpy program, we will calculate the standard deviation of an array using NumPy.
Steps to solve the program
- Import the numpy library as np.
- Create an array using np.array().
- Calculate the standard deviation of the array using np.std().
- Print the output.
import numpy as np
age = np.array([20,25,21,23,26,27,26,30,24,26])
print("Standard Deviation: ",np.std(age))
Output :
Standard Deviation: 2.7856776554368237