Tsallaka zuwa abun ciki
Justice Tech School

Series Statistics

Series have methods such as sum, mean, median, std, min, max and describe. They skip missing values by default.

Example
import pandas as pd
import numpy as np
s = pd.Series([4, 8, 15, 16, 23, 42])
print(s.sum(), s.mean(), s.median())
print(round(s.std(), 3), s.min(), s.max())
print(s.describe().round(2))

Result

108 18.0 15.5
13.491 4 42
count     6.00
mean     18.00
std      13.49
min       4.00
25%       9.75
50%      15.50
75%      21.25
max      42.00
dtype: float64

Exercise

Average.

s.()

Quiz Test

Do statistics skip NaN by default?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.