DataFrame: Creation and Attributes: Class 12 PYQs 2024–2026 with solutions
All 9 CBSE board questions asked from DataFrame: Creation and Attributes in 3 board papers, with the year, set and marks of each. 6 are solved free below. The Class 12 Informatics Practices PYQ Book: Solved Board Papers 2024-2026 (CBSE) has every solution, all chapters and 3 full board papers.
DataFrame: Creation and Attributes: board weightage
Board weightage 2024–2026
| Year | 2024 | 2025 | 2026 |
|---|---|---|---|
| Questions | 3 | 4 | 2 |
| Marks | 6 | 8 | 4 |
Most asked topics
9 questions from 3 papers. Repeated questions are shown once with every year they were asked.
1 mark: MCQ and Assertion–Reason
A–R. (A): A DataFrame can store values of multiple data types in multiple columns. (R): DataFrames are implemented using 2D arrays, which allow only numeric values.
Solution
(C) A is true; R is false (columns can hold strings, floats, ints…).
True or False: In Python, we cannot create an empty DataFrame.
Solution
False. df = pd.DataFrame() creates an empty DataFrame (df.empty → True).
A–R. (A): A Series is a one dimensional array and a DataFrame is a two-dimensional array containing a sequence of values of any data type. (R): Both Series and DataFrames have by default numeric indexes starting from zero.
2 marks: very short answer
(a) Two differences between Series and DataFrame.
Solution
Series is one-dimensional, DataFrame two-dimensional; a Series stores a single column, a DataFrame many columns (also: Series is homogeneous, DataFrame heterogeneous; Series size immutable, DataFrame size mutable).
(b) Complete the code to print COLOUR, NAME, QTY rows Red Apple 10, Blue Berry 15, Green Guava 20: import ____ as pd / data=[{…},{…},{____, 'NAME':'Guava','QTY':20}] / df=pd.DataFrame(____) / print(____)
Solution
import pandas as pd
data = [{'COLOUR':'Red', 'NAME':'Apple', 'QTY':10},
{'COLOUR':'Blue', 'NAME':'Berry', 'QTY':15},
{'COLOUR':'Green', 'NAME':'Guava', 'QTY':20}]
df = pd.DataFrame(data)
print(df)
Complete the code (S1 names with index 10, 16, 18; S2 subjects; S3 marks) to print Name/Subject/Marks rows 10 Rubina IP 56, 16 Jaya HSc 67, 18 Vaibhav IP 86.
3 marks: short answer
36(I) Create the DataFrame Scholarship (Name: Ananya, Karan, Simran, Rahul, Priya; Course: B.Sc., B.Tech, MCA, BCA, BA; Amount: 62000, 67000, 64000, 70000, 69000) using the dictionary of Series method.
Solution
import pandas as pd(Parts II and III, renaming the index and removing the last row, are in Chapter 3.)
name = pd.Series(["Ananya","Karan","Simran","Rahul","Priya"])
course = pd.Series(["B.Sc.","B.Tech","MCA","BCA","BA"])
amount = pd.Series([62000, 67000, 64000, 70000, 69000])
Scholarship = pd.DataFrame({"Name":name, "Course":course,
"Amount":amount})
print(Scholarship)
(a) Create, using a dictionary of Series, the DataFrame with City (Mumbai, Dehradun, Bengaluru, Hyderabad) and State (Maharashtra, Uttarakhand, Karnataka, Telangana).
Solution
import pandas as pd
d = {'City': pd.Series(['Mumbai','Dehradun','Bengaluru','Hyderabad']),
'State': pd.Series(['Maharashtra','Uttarakhand','Karnataka','Telangana'])}
df = pd.DataFrame(d)
print(df)
City State
0 Mumbai Maharashtra
1 Dehradun Uttarakhand
2 Bengaluru Karnataka
3 Hyderabad Telangana
Kabir stores voters' name and age; create a list of dictionaries and a DataFrame with row labels Ar1001, Ba3002, Go4002, Dh4007, Na6005 (Arjun 35, Bala 23, Govind 25, Dhruv 19, Navya 18).
Get every solution for all chapters
- Every board question of every chapter, each fully solved the way the board gives marks
- 3 complete board papers, each followed by its solutions
- Weightage and most-asked topics for every chapter
- Instant PDF download, colour and black & white print copies
Revising the chapter first? Complete Informatics Practices Notes for Class 12 (CBSE 065, 2026-27) →
What you get in the pack
- CBSE Class 12 Informatics Practices board papers 2024 to 2026 (3 full board papers)
- All 9 chapters and 3 board papers complete
- Part A: all 9 chapters, questions sorted chapter-wise and by marks
- Year-wise weightage table and most-asked topics for every chapter
- Part B: each full board paper followed by its complete solutions
- Pandas, Matplotlib and SQL answers verified by running the code
- Only the current syllabus in Part A
All chapters in this pack
- PYQ Ch 1 Pandas Series
- PYQ Ch 2 DataFrame: Creation and Attributes
- PYQ Ch 3 DataFrame Operations and CSV Files
- PYQ Ch 4 Data Visualisation with Matplotlib
- PYQ Ch 5 SQL Revision and Single-row Functions
- PYQ Ch 6 SQL Aggregates, Grouping and Joins
- PYQ Ch 7 Computer Networks
- PYQ Ch 8 Introduction to the Internet and Web
- PYQ Ch 9 Societal Impacts
- Board Paper 2026 Set 90 with Solutions
- Board Paper 2025 Set 90 with Solutions
- Board Paper 2024 Set 90 with Solutions
