Statistics
median, percentile, std, var and corrcoef describe data. Use ddof=1 for the sample standard deviation.
Example
import numpy as np
a = np.array([2, 4, 4, 4, 5, 5, 7, 9])
print(np.median(a), np.mean(a), np.std(a))
print(np.percentile(a, 50), round(np.std(a, ddof=1), 3))Result
4.5 5.0 2.0 4.5 2.138
Exercise
Middle value.
np.(a)
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.