Perform the following Aggregate and Statistical Functions using Numpy Array. array1 = np.array([[10, 20, 30], [40, 50, 60]]). Data science using Python in Anaconda - Jupyter
Question
1. Mean
2. Standard deviation
3. Variance
4. Sum of array elements
5. Product of array elements
Program: -
import numpy as np
array1 = np.array([[10, 20, 30], [40, 50, 60]])
print("Orignal Array 1:- \n",array1,"\n")
print("Mean :-",np.mean(array1))
print("Standard deviation :-",np.std(array1))
print("Variance :-",np.var(array1))
print("Sum of array elements :-",np.sum(array1))
print("Product of array elements :-",np.prod(array1))
Output: -
Orignal Array 1:-
[[10 20 30]
[40 50 60]]
Mean :- 35.0
Standard deviation :- 17.07825127659933
Variance :- 291.6666666666667
Sum of array elements :- 210
Product of array elements :- 720000000