School Revise · Class 12 Information Practices · Chapter 2
Code 065, Class 12. Pandas is a Python library for working with data. Here we meet its two main structures, the Series and the DataFrame.
|
|
Pandas handles data in Python. A Series is a single labelled column of values. A DataFrame is a table with rows and columns.
A Series holds values with an index (labels). We create it from a list, and read a value by its label or position.
|
import pandas as pd s = pd.Series([10, 20, 30]) print(s[1]) Output: 20 |
A DataFrame is a table. We often make one from a dictionary, where each key is a column. We read a column with df[“column”].
Pandas can read and write data files. read_csv() loads a CSV file into a DataFrame, and to_csv() saves a DataFrame to a CSV file.
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
A single labelled column of values.
A table with rows and columns.
read_csv().
number of rows and columns.
|
Pandas handles data in Python. A Series is one labelled column, read by label or position. A DataFrame is a table, often made from a dictionary of columns and read with df[“column”]. read_csv() loads a CSV into a DataFrame and to_csv() saves it. df.shape gives the number of rows and columns. |
| Open the Virtual Lab |
These free Class 12 Informatics Practices notes explain the Pandas library, Series and DataFrame, creating and reading them, and importing and exporting CSV data 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.