School Revise · Class 12 Information Practices · Chapter 3
Code 065, Class 12. Pandas can also summarise and tidy data. Here we find statistics, sort and group data, and handle missing values.
|
|
Beyond storing data, Pandas can summarise it with statistics, sort and group it, and clean it by handling missing values.
Methods like mean(), sum(), max(), min() and count() summarise a column. describe() gives several statistics at once.
|
import pandas as pd df = pd.DataFrame({“marks”: [80, 90, 70]}) print(df[“marks”].mean()) Output: 80.0 |
sort_values(“col”) sorts rows by a column. groupby(“col”) groups rows so you can summarise each group, for example the average marks per class.
Real data often has gaps. isnull() finds missing values, fillna(value) fills them, and dropna() removes rows that have them.
Explore the idea by tapping. The interactive opens right here in the lesson.
Write and run real Python right here in the lesson, then work through the practice problems with answers.
Type each one into the code lab above, then open the card to see the worked solution and its output.
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
mean().
sort_values().
groupby().
fillna().
|
Pandas summarises data with mean(), sum(), max(), min(), count() and describe(). sort_values() sorts by a column and groupby() summarises each group, such as the average per class. Missing values are found with isnull(), filled with fillna() and removed with dropna(). |
| Open the Virtual Lab |
These free Class 12 Informatics Practices notes explain Pandas descriptive statistics, sorting and grouping data, groupby, and handling missing values with fillna and dropna with worked examples and practice, for CBSE students across India and the Gulf including the UAE, Saudi Arabia, Qatar, Oman, Kuwait and Bahrain.
© 2026 School Revise. All rights reserved. Original content aligned to the CBSE and NCERT Class 12 Informatics Practices syllabus. Unauthorised copying is not permitted.