Describing Data
describe gives count, mean, std, min, quartiles and max. include="all" adds text columns.
Example
df = pd.DataFrame({"name": ["Ada", "Kofi", "Amina", "Tunde"], "country": ["NG", "GH", "NG", "NG"], "score": [92, 78, 85, 71]})
print(df["score"].describe())
print(df.describe(include="all").shape)Result
count 4.000000 mean 81.500000 std 9.036961 min 71.000000 25% 76.250000 50% 81.500000 75% 86.750000 max 92.000000 Name: score, dtype: float64 (11, 3)
Exercise
Summary.
s.()
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.