CBSESetWise.in

Class 12 Informatics Practices: Data Handling using Pandas PYQs (2022–2026)

Authentic CBSE board questions & official stepwise marking scheme solutions for Data Handling using Pandas (Chapter 1).

Data Handling using Pandas

Series and DataFrame creation, indexing (loc, iloc), head(), tail(), drop(), boolean slicing, and CSV file operations.

Key Topics: Series Creation, DataFrame Indexing, head() and tail(), drop() and rename(), Boolean Slicing, CSV I/O

Download Chapter Booklet PDF (18 Pages)

Data Handling using Pandas Previous Year Questions & Solutions (28 Questions)

Q1 • CBSE 2026 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2026 Board Examination (Set 4) — Question Q1 (1 Mark) State whether the following statement is True or False : In Pandas Series, the Positional index can be a string or an integer. 1

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2026 1 Mark PYQ Q1
Official CBSE Marking Scheme Solution

False (1 mark for writing the correct answer)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2026 1 Mark PYQ Q1 Official Solution
Q2 • CBSE 2026 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2026 Board Examination (Set 4) — Question Q2 (1 Mark) We can add a new row to a DataFrame DF using the _________ method. (A) DF.add() (B) DF.loc[] (C) DF.loc() (D) DF.addloc[] 1

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2026 1 Mark PYQ Q2
Official CBSE Marking Scheme Solution

(B) DF.loc[] (1 Mark for writing the correct option)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2026 1 Mark PYQ Q2 Official Solution
Q12 • CBSE 2026 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2026 Board Examination (Set 4) — Question Q12 (1 Mark) CSV stands for ___________________ Separated Values. (A) Colon (B) CTRL (C) Comma (D) Caret 1

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2026 1 Mark PYQ Q12
Official CBSE Marking Scheme Solution

(C) Comma (1 Mark for writing the correct option)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2026 1 Mark PYQ Q12 Official Solution
Q18 • CBSE 2026 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2026 Board Examination (Set 4) — Question Q18 (1 Mark) In a Pandas DataFrame, which value for the axis will be used to delete a column ? (A) axis = -1 (B) axis = 0 (C) axis = 1 (D) axis = 2 1

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2026 1 Mark PYQ Q18
Official CBSE Marking Scheme Solution

(C) axis = 1 (1 Mark for the correct answer)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2026 1 Mark PYQ Q18 Official Solution
Q20 • CBSE 2026 • 2 Marks • Data Handling using Pandas (Chapter 1)

CBSE 2026 Board Examination (Set 4) — Question Q20 (2 Marks) Assertion (A) : Pandas DataFrame can store values of multiple data types in multiple Columns. Reason (R) : DataFrames are implemented using 2D arrays, which allows only numeric values. 1

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2026 2 Mark PYQ Q20
Official CBSE Marking Scheme Solution

(C) (A) is True, but (R) is False. (1 Mark for writing the correct option)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2026 2 Mark PYQ Q20 Official Solution
Q24 • CBSE 2026 • 2 Marks • Data Handling using Pandas (Chapter 1)

CBSE 2026 Board Examination (Set 4) — Question Q24 (2 Marks) Define the following terms with respect to RDBMS : a. Domain b. Tuple 2

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2026 2 Mark PYQ Q24
Official CBSE Marking Scheme Solution

a. Domain: The set of all possible values that a column (attribute) can contain. b. Tuple: A row in a table representing a complete record. a. (1 Mark for writing the correct definition of Domain) b. (1 Mark for writing the correct definition of Tuple)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2026 2 Mark PYQ Q24 Official Solution
Q36 • CBSE 2026 • 5 Marks • Data Handling using Pandas (Chapter 1)

CBSE 2026 Board Examination (Set 4) — Question Q36 (5 Marks) [ CBSE MS Informatics Practices Subject Code 065 Paper Code 90 Class 12 Main 2026 Page: 19/22 ] Consider the DataFrame Scholarship shown below : Name Course Amount 3+ 1+ 1=

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2026 5 Mark PYQ Q36
Official CBSE Marking Scheme Solution

[ CBSE MS Informatics Practices Subject Code 065 Paper Code 90 Class 12 Main 2026 Page: 20/22 ] 0 Ananya B.Sc. 62000 1 Karan B.Tech 67000 2 Simran MCA 64000 3 Rahul BCA 70000 4 Priya BA 69000 Answer the following questions : 5 I. Write Python code to create and display the given DataFrame using the Dictionary of Series method. import pandas as pd # Creating Series for each column 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]) # Creating DataFrame using Dictionary of Series data = {"Name": name, "Course": course, "Amount": amount } Scholarship = pd.DataFrame(data) # Display the DataFrame print(Scholarship) OR import pandas as pd # Creating Series for each column Name=["Ananya", "Karan", "Simran", "Rahul", "Priya"] Course=["B.Sc.", "B.Tech", "MCA", "BCA", "BA"] Amount=[62000, 67000, 64000, 70000, 69000] name = pd.Series(Name) course = pd.Series(Course) amount = pd.Series(Amount) # Creating DataFrame using Dictionary of Series data = {"Name": name, "Course": course, "Amount": amount} Scholarship = pd.DataFrame(data) # Display the DataFrame print(Scholarship) (½ Mark for import pandas as pd) (½ Mark each for creation of Series for columns - Name, Course and Amount) (½ Mark for creation of DataFrame using dictionary of Series) (½ Mark for displaying the DataFrame) II. Rename row indexes to ['a', 'b', 'c', 'd', 'e'] Scholarship.index = ['a', 'b', 'c', 'd', 'e'] OR Scholarship = Scholarship.set_axis(['a', 'b', 'c', 'd', 'e'], axis=0) OR Scholarship = Scholarship.rename(index={0: 'a', 1: 'b', 2: 'c', 3: 'd',4: 'e'}) OR Any other valid method (1 mark for correctly renaming the row indexes) OR (½ mark for writing set_axis , ½ mark for correct values ['a','b','c','d','e'] ) III. Write Python statement to remove the last row of the given DataFrame Scholarship = Scholarship.drop(Scholarship.index[-1]) OR Scholarship = Scholarship.iloc[:-1] OR Scholarship = Scholarship.drop('e') OR Scholarship = Scholarship.drop(4) OR Scholarship.drop(Scholarship.index[-1], inplace=True) OR Scholarship = Scholarship.drop(Scholarship.tail(1).index) (½ mark for writing Scholarship.drop()/iloc[] ) (½ mark for writing correct argument of drop()/iloc[] )

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2026 5 Mark PYQ Q36 Official Solution
Q1 • CBSE 2025 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2025 Board Examination (Set 4) — Question Q1 (1 Mark) State whether the following statement is True or False: In Python, we cannot create an empty DataFrame 1

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2025 1 Mark PYQ Q1
Official CBSE Marking Scheme Solution

False (1 Mark for writing the correct answer)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2025 1 Mark PYQ Q1 Official Solution
Q6 • CBSE 2025 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2025 Board Examination (Set 4) — Question Q6 (1 Mark) What is the default index type for a Pandas Series if not explicitly specified ? (A) String (B) List (C) Numeric (D) Boolean 1

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2025 1 Mark PYQ Q6
Official CBSE Marking Scheme Solution

(C)​ Numeric (1 Mark for writing the correct answer)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2025 1 Mark PYQ Q6 Official Solution
Q9 • CBSE 2025 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2025 Board Examination (Set 4) — Question Q9 (1 Mark) Which of the following data structure is used for storing one-dimensional labelled data in Python Pandas ? (A) Integer (B) Dictionary (C) Series (D) DataFrame 1

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2025 1 Mark PYQ Q9
Official CBSE Marking Scheme Solution

(C) Series (1 Mark for writing the correct answer)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2025 1 Mark PYQ Q9 Official Solution
Q12 • CBSE 2025 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2025 Board Examination (Set 4) — Question Q12 (1 Mark) Which protocol is used while communicating through video calls on the Internet ? (A)​Video Over Internet Protocol (B)​Voice Over Internet Protocol (C)​Internet Protocol (D)​Video Audio Over Internet Protocol 1

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2025 1 Mark PYQ Q12
Official CBSE Marking Scheme Solution

(B) Voice Over Internet Protocol (1 Mark for writing the correct answer)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2025 1 Mark PYQ Q12 Official Solution
Q14 • CBSE 2025 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2025 Board Examination (Set 4) — Question Q14 (1 Mark) Excessive screen time and poor posture can lead to : (A)​Faster Internet Speeds (B)​Eye strain and other health issues (C)​Better vision and bone density (D)​Improved physical health 1

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2025 1 Mark PYQ Q14
Official CBSE Marking Scheme Solution

(B) Eye strain and other health issues (1 Mark for writing the correct answer)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2025 1 Mark PYQ Q14 Official Solution
Q18 • CBSE 2025 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2025 Board Examination (Set 4) — Question Q18 (1 Mark) In Python Pandas, DataFrame. ________ [] is used for label indexing with DataFrames. (A) label (B) index (C) labindex (D) loc 1

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2025 1 Mark PYQ Q18
Official CBSE Marking Scheme Solution

(D) loc (1 Mark for writing the correct answer)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2025 1 Mark PYQ Q18 Official Solution
Q36 • CBSE 2025 • 5 Marks • Data Handling using Pandas (Chapter 1)

CBSE 2025 Board Examination (Set 4) — Question Q36 (5 Marks) Consider the DataFrame Doctor shown below: 5 [ CBSE MS Informatics Practices Subject Code 065 Paper Code 90 Class 12 Main 2025 Page: 21/24 ] DID NAME DEPARTMENT FEE 0 101 Dr. Joe ENT 1500 1 102 Dr. Salma UROLOGY 1600 2 103 Dr. Jeet ORTHO 1550 3 104 Dr. Neha ENT 1200 4 105 Dr. Vikram ORTHO 1700 Write suitable Python statements for the following: (i) To print the last three rows of the DataFrame Doctor.

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2025 5 Mark PYQ Q36
Official CBSE Marking Scheme Solution

print(doctor.tail(3)) OR print(doctor.iloc[-3:]) (1 mark for writing the correct statement) (ii) To display the names of all doctors. print(doctor['Name']) OR print(doctor.iloc[:,[1]]) OR print(doctor.loc[:,['Name']]) (1 mark for writing the correct statement) (iii) To add a new column 'Discount' with value of 200 for all doctors. doctor['Discount']=200 OR doctor.loc[:, "Discount"] = 200 (1 mark for writing the correct statement) (iv) To display rows with index 2 and 3. print(doctor.loc[[2,3]]) OR print(doctor.iloc[[2,3]]) OR print(doctor[2:4]) (1 mark for writing the correct statement) (v) To delete the column 'Department'. doctor.drop(['Department'],axis=1, inplace=True) OR doctor = doctor.drop(['Department'],axis=1) (1 mark for writing the correct statement) Note: axis=1 can be replaced with axis= 'columns' [ CBSE MS Informatics Practices Subject Code 065 Paper Code 90 Class 12 Main 2025 Page: 22/24 ]

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2025 5 Mark PYQ Q36 Official Solution
Q7 • CBSE 2024 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2024 Board Examination (Set 4) — Question Q7 (1 Mark) Which of the following is NOT true with respect to CSV files ? 1 (i) Values are separated by commas. (ii) to_csv() can be used to save a dataframe to a CSV file. (iii) CSV file is created using a word processor. (iv) CSV file is a type of text file.

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2024 1 Mark PYQ Q7
Official CBSE Marking Scheme Solution

All the options are true with respect to CSV files. (Full 1 mark to be awarded for attempt / any one or more options is/are mentioned)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2024 1 Mark PYQ Q7 Official Solution
Q10 • CBSE 2024 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2024 Board Examination (Set 4) — Question Q10 (1 Mark) Page 4/23 What will be the output of the following Python code ? import pandas as pd dd= { 'One':1, 'Two':2, 'Three':3, 'Seven':7} rr=pd.Series(dd) rr['Four']=4 print(rr) 1 (i) One 1 Two 2 Three 3 Seven 7 dtype: int64 (ii) One 1 Two 2 Three 3 Four 4 Seven 7 dtype: int64 CBSE AISSCE 2024 Marking Scheme for Informatics Practices (Sub Code: 065 Paper Code 90) SET-4 (iii) Four 4 One 1 Two 2 Three 3 Seven 7 dtype: int64 (iv) One 1 Two 2 Three 3 Seven 7 Four 4 dtype: int64

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2024 1 Mark PYQ Q10
Official CBSE Marking Scheme Solution

(iv) One 1 Two 2 Three 3 Seven 7 Four 4 dtype: int64 Note: Full 1 mark to be awarded for attempt / any one or more options is/are mentioned

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2024 1 Mark PYQ Q10 Official Solution
Q20 • CBSE 2024 • 2 Marks • Data Handling using Pandas (Chapter 1)

CBSE 2024 Board Examination (Set 4) — Question Q20 (2 Marks) The Python code written below has syntactical errors. Rewrite the correct code and underline the correction(s) made. import Pandas as pd stud=['Name':'Ramya','Class':11,'House':'Red'] s=p.Series(s) print(s) 2

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2024 2 Mark PYQ Q20
Official CBSE Marking Scheme Solution

Page 7/23 import pandas as pd stud = {'Name':'Ramya', 'Class':11, 'House':'Red'} s = pd.Series(stud) print(s) (½ Mark for correcting each syntactical error) Note: Only 1 mark to be awarded if all the errors are correctly identified but correct code not written. CBSE AISSCE 2024 Marking Scheme for Informatics Practices (Sub Code: 065 Paper Code 90) SET-4

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2024 2 Mark PYQ Q20 Official Solution
Q22 • CBSE 2024 • 2 Marks • Data Handling using Pandas (Chapter 1)

CBSE 2024 Board Examination (Set 4) — Question Q22 (2 Marks) Find the output of the following Python code : import pandas as pd com=pd.Series([45,12,15,200],index=['mouse','printer', 'webcam','keyboard']) print(com[l:3]) 2

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2024 2 Mark PYQ Q22
Official CBSE Marking Scheme Solution

printer 12 webcam 15 dtype: int64 (1 Mark for each row of correct output) Note: ● Ignore dtype: int64 ● Ignore order of columns in the output ● Only 1 mark to be awarded if an extra row is mentioned in the output

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2024 2 Mark PYQ Q22 Official Solution
Q24 • CBSE 2024 • 2 Marks • Data Handling using Pandas (Chapter 1)

CBSE 2024 Board Examination (Set 4) — Question Q24 (2 Marks) Page 8/23 Consider the following Python code : import pandas as pd Sl=pd.Series(['Rubina','Jaya','Vaibhav'],index=[10,16,18]) S2=pd.Series( , index=[10,16,18]) S3=pd.Series([56,67,86], ) xiia={'Name': ,'Subject':S2,'Marks':S3} df=pd.DataFrame( ) print(df) Complete the above Python code to display the following output : Name Subject Marks 10 Rubina IP 56 16 Jaya HSc 67 18 Vaibhav IP 86 2 CBSE AISSCE 2024 Marking Scheme for Informatics Practices (Sub Code: 065 Paper Code 90) SET-4

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2024 2 Mark PYQ Q24
Official CBSE Marking Scheme Solution

import pandas as pd S1=pd.Series(['Rubina','Jaya','Vaibhav'], index=[10,16,18]) S2=pd.Series(['IP','HSc','IP'], index=[10,16,18]) S3=pd.Series([56,67,86], index=[10,16,18]) xiia={'Name':S1, 'Subject':S2, 'Marks':S3} df=pd.DataFrame(xiia) print(df) (½ Mark each for writing each correct missing part of the given code)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2024 2 Mark PYQ Q24 Official Solution
Q32 • CBSE 2024 • 5 Marks • Data Handling using Pandas (Chapter 1)

CBSE 2024 Board Examination (Set 4) — Question Q32 (5 Marks) Page 16/23 Ms. Ritika conducted an online assessment and stored the details in a DataFrame result as given below : Name Score Attempts Qualify a Atulya 12.5 1 yes b Disha 9.0 3 no C Kavita 16.5 2 yes d John 15.0 1 no Answer the following questions : 4 (i) Predict the output of the following Python statement: print(result.loc [:,'Attempts'] > 1) CBSE AISSCE 2024 Marking Scheme for Informatics Practices (Sub Code: 065 Paper Code 90) SET-4

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2024 5 Mark PYQ Q32
Official CBSE Marking Scheme Solution

(i) a False b True c True d False Name: Attempts, dtype: bool (1 Mark for writing the correct output) Name: Attempts, dtype: bool to be ignored Note: Full 1 Mark to be awarded if rows b and c are mentioned (ii) Write the Python statement to display the last three records. (ii) print(result.tail(3)) OR print(result.iloc[1:]) OR print(result.iloc[1:4]) OR print(result.iloc[[1,2,3],:]) OR print(result.loc[["b","c","d"]]) (1 Mark for writing the correct Python Statement) (iii) Write Python statement to display records of 'a ' and 'd' row labels. (iii) print(result.loc[["a","d"]]) OR print(result.iloc[[0,3],:]) (2 Marks for writing the correct Python Statement) (iii) OR (Option for Part (iii) only) Write suitable Python statement to retrieve the data stored in the file, 'registration.csv' into a DataFrame, 'regis'. (iii) regis=pd.read_csv("registration.csv") (2 Marks for writing the correct Python Statement) SECTION-E

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2024 5 Mark PYQ Q32 Official Solution
Q10 • CBSE 2023 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2023 Board Examination (Set 4) — Question Q10 (1 Mark) What will be the output of the following code ? import pandas as pd myser = pd.Series([0, 0,0]) print(myser) (i) 0 0 (ii) 0 1 0 0 0 1 0 0 0 2 (iii) 0 0 (iv) 0 0 1 0 1 1 2 0 2 2 1 - 4 of 20- CBSE AISSCE 2023 Marking Scheme for Informatics Practices ies ⅀HEFG (Sub Code: 065 Paper Code 90) SET-4

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 1 Mark PYQ Q10
Official CBSE Marking Scheme Solution

Ans (iii) 0 0 1 0 2 0 (1 Mark for correct answer)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 1 Mark PYQ Q10 Official Solution
Q11 • CBSE 2023 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2023 Board Examination (Set 4) — Question Q11 (1 Mark) Which of the following is a two-dimensional labelled data structure of Python ? (i) Relation (ii) Dataframe (iii) Series (iv) Square 1

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 1 Mark PYQ Q11
Official CBSE Marking Scheme Solution

Ans (ii) Dataframe (1 Mark for correct answer)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 1 Mark PYQ Q11 Official Solution
Q12 • CBSE 2023 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2023 Board Examination (Set 4) — Question Q12 (1 Mark) To compare data values of commission earned by salesmen over a year, which of the following type of graph should preferably be used ? (i) line (ii) area (iii) bar (iv) scatter 1

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 1 Mark PYQ Q12
Official CBSE Marking Scheme Solution

Ans (i) line OR (iii) bar OR (iv) scatter (1 Mark for correct answer)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 1 Mark PYQ Q12 Official Solution
Q18 • CBSE 2023 • 1 Mark • Data Handling using Pandas (Chapter 1)

CBSE 2023 Board Examination (Set 4) — Question Q18 (1 Mark) Assertion (A) : The output of addition of two series will be NaN, if one of the elements or both the elements have no value(s). Reason (R) : While performing mathematical operations on a series, by default all missing values are filled in with 0.

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 1 Mark PYQ Q18
Official CBSE Marking Scheme Solution

Ans (iii) (A) is true but (R) is false. (1 Mark for correct answer) PART - B

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 1 Mark PYQ Q18 Official Solution
Q24 • CBSE 2023 • 2 Marks • Data Handling using Pandas (Chapter 1)

CBSE 2023 Board Examination (Set 4) — Question Q24 (2 Marks) What will be the output of the following code: import pandas as pd s1=pd.Series(data=2*(3,10)) print(s1) 2

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 2 Mark PYQ Q24
Official CBSE Marking Scheme Solution

Ans 0 3 1 10 2 3 3 10 NOTE: ● Full 2 marks to be awarded for attempting the question/mentioning error in question/out of curriculum

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 2 Mark PYQ Q24 Official Solution
Q25 • CBSE 2023 • 2 Marks • Data Handling using Pandas (Chapter 1)

CBSE 2023 Board Examination (Set 4) — Question Q25 (2 Marks) Carefully observe the following code: import pandas as pd dic={'pid': [101, 102, 103, 104, 105], 'pname': ['Shyam', 'Roushan', 'Archit', 'Medha', 'Lalit'], 'sports': ['Cricket', 'Tennis', 'Football', 'Cricket', 'Cricket'], 'points': [45000,20000, 15000, 53000, 60000]} player=pd.DataFrame (dic) print (player) Write Python statements for the following: 2 (i) In the dataframe player created above, set the row labels as 'Player1', 'Player2', 'Player3', 'Player4', 'Player5'.

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 2 Mark PYQ Q25
Official CBSE Marking Scheme Solution

Ans player=pd.DataFrame (dic,index=['Player1','Player2','Player3','Player4','Player5']) OR I=['Player1','Player2','Player3','Player4','Player5'] player=pd.DataFrame (dic,index=I) (½ Mark for creating DataFrame) (½ Mark for index) (ii) Rename the column 'points' to 'netpoint' in the DataFrame player. Ans player=player.rename({'points':'netpoints'},axis='columns') OR player.rename({'points':'netpoints'},axis='columns',inplace=True) OR player=player.rename({'points':'netpoints'},axis=1) OR player=player.rename(columns={'points':'netpoints'}) OR player.rename({'points':'netpoints'},axis=1,inplace=True) - 9 of 20- CBSE AISSCE 2023 Marking Scheme for Informatics Practices ies ⅀HEFG (Sub Code: 065 Paper Code 90) SET-4 OR player.rename(columns={'points':'netpoints'},inplace=True) (1 Mark for any correct Python statement) SECTION - C

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 2 Mark PYQ Q25 Official Solution
Q27 • CBSE 2023 • 3 Marks • Data Handling using Pandas (Chapter 1)

CBSE 2023 Board Examination (Set 4) — Question Q27 (3 Marks) Kavyanjali, a chemical analyst, needs to arrange data of few elements in the form of two series containing symbols and their atomic numbers respectively. Thereafter, the data of these two series has to be arranged and displayed in the form of Data Frame as shown below Symbol Atomic Number Hydrogen H 1 Helium He 2 Lithium Li 3 Beryllium Be 4 Help her in writing suitable Python code to complete the task. 3 - 10 of 20- CBSE AISSCE 2023 Marking Scheme for Informatics Practices ies ⅀HEFG (Sub Code: 065 Paper Code 90) SET-4

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 3 Mark PYQ Q27
Official CBSE Marking Scheme Solution

Ans import pandas as pd I=['Hydrogen','Helium','Lithium','Beryllium'] D1=['H','He','Li','Be'] D2=[1,2,3,4] S1=pd.Series(D1,I) print("First Series: ") print(S1) S2=pd.Series(D2,I) print("Second Series: ") print(S2) D = {'Symbol': S1,'Atomic Number': S2} DF=pd.DataFrame(D) print("DataFrame:") print(DF) OR import pandas as pd D={'Symbol':['H','He','Li','Be'],'Atomic Number':[1,2,3,4]} DF=pd.DataFrame(d,index=['Hydrogen','Helium','Lithium','Berillium ']) print(DF) (½ Mark for correctly interpreting 'Hydrogen','Helium','Lithium','Beryllium') (½ Mark for correctly interpreting ['H','He','Li','Be'] & [1,2,3,4]) (½ Mark for correctly interpreting Symbols as implicit/explicit series) (½ Mark for correctly interpreting Atomic Numbers as implicit/explicit series) (½ Mark for correctly creating DataFrame) (½ Mark for displaying all/some content using print)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 3 Mark PYQ Q27 Official Solution
Q28 • CBSE 2023 • 3 Marks • Data Handling using Pandas (Chapter 1)

CBSE 2023 Board Examination (Set 4) — Question Q28 (3 Marks) Consider the given DataFrame 'health'. Diseasename Agent 0 Common cold Virus 1 Chickenpox Virus 2 Cholera Bacteria 3 Tuberculosis Bacteria Write suitable Python statements for the following: 3 (i) Remove the row containing details of disease named Tuberculosis.

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 3 Mark PYQ Q28
Official CBSE Marking Scheme Solution

Ans I = DF[ DF['Diseasename'] == 'Tuberculosis' ].index DF.drop(I, inplace = True) OR DF.drop('Tuberculosis',axis=0) OR DF=DF[(DF.diseasename!='Tuberculosis')] (1 Mark for mentioning DF.drop() OR DF.drop(3)) Note: Conditional deletion is not in curriculum (ii) Add a new disease named 'Malaria' caused by 'Protozoa' Ans DF.loc[4]=['Malaria','Protozoa'] OR DF.loc[4,:] = ['Malaria','Protozoa'] OR DF = DF.append({'Diseasename':'Malaria','Agent':'Protozoa'}, ignore_index=True) - 11 of 20- CBSE AISSCE 2023 Marking Scheme for Informatics Practices ies ⅀HEFG (Sub Code: 065 Paper Code 90) SET-4 (½ Mark for mentioning/identifying proper location ) (½ Mark for mentioning 'Malaria','Protozoa' correctly) OR (1 Mark for the last option of the answer) (iii) Display the last 2 rows. Ans print(DF.iloc[3:5]) OR print(DF.tail(2)) OR print(DF.iloc[-2::]) (½ Mark for using iloc/tail) (½ Mark for correct index)

CBSE Class 12 Data Handling using Pandas (Chapter 1) 2023 3 Mark PYQ Q28 Official Solution

Other Informatics Practices Chapters

Data Handling using Pandas • Data Visualization with Matplotlib • Database Query using SQL • Introduction to Computer Networks • Societal Impacts