NumPy has quite a few useful statistical functions for finding minimum, maximum, percentile standard deviation and variance, etc from the given elements in the array. The functions are explained as follows −

Statistical function

Numpy is equipped with the robust statistical function as listed below

Function Numpy
Min np.min()
Max np.max()
Mean np.mean()
Median np.median()
Standard deviation np.std()

Consider the following Array

import numpy as np
normal_array = np.random.normal(5, 0.5, 10)
print(normal_array)		

Output:

[5.56171852 4.84233558 4.65392767 4.946659   4.85165567 5.61211317 4.46704244 5.22675736 4.49888936 4.68731125]			

Example:Statistical function

### Min 
print(np.min(normal_array))

### Max 
print(np.max(normal_array))

### Mean 
print(np.mean(normal_array))

### Median
print(np.median(normal_array))

### Sd
print(np.std(normal_array))

Output:

4.467042435266913
5.612113171990201
4.934841002270593
4.846995625786663
0.3875019367395316

 

YOU MIGHT LIKE: