DATA MUNGING
PYTHON MATRIX

In [1]:

```
## How to Calculate Mean, Variance and Std a Matrix or ndArray
def Kickstarter_Example_11():
print()
print(format('How to Calculate Mean, Variance and Std a Matrix or ndArray'
,'*^72'))
# Load library
import numpy as np
# Create matrix
matrixA = np.array([[1, 2, 3, 23],
[4, 5, 6, 25],
[7, 8, 9, 28],
[10, 11, 12, 41]])
# Return median, mean, variance and std
print(); print("Median: ", np.median(matrixA))
print(); print("Mean: ", np.mean(matrixA))
print(); print("Variance: ", np.var(matrixA))
print(); print("Standrad Dev: ", np.std(matrixA))
Kickstarter_Example_11()
```

Stuck at work?

Can't find the recipe you are looking for. Let us know and we will find an expert to create the recipe for you.
Click here

Companies using this Recipe