Instagram
youtube
Facebook
Twitter

Find the Standard Deviation of a NumPy Array

     A Find the Standard Deviation of a NumPy Array
     
      Short Description of the Program:

      This program calculates the standard deviation of all values in a NumPy array using the np.std() function.
      
       Explanation:

  • np.array()
    Creates a 2D array filled with numeric values.

     
  • np.std(array_values)
    Computes the standard deviation, which measures how spread out the numbers are from the mean.

     
  • print()
    Outputs both the original array and the standard deviation.

     

Program:

import numpy as np

array_values = np.array([[10, 20, 30], [40, 50, 60]])

std_deviation = np.std(array_values)

print("NumPy Array:\n", array_values)

print("\nStandard Deviation of the Array:", std_deviation)