Python Pandas Question Paper Class11
Python Pandas Question Paper Class11
Time: 2 Hours
Max Marks: 40
General Instructions:
- All questions are compulsory.
- Answer the questions as directed.
- Write code clearly with correct syntax and indentation.
2. A Series in pandas is a:
a) 2D labeled array
b) 1D labeled array
c) List
d) Dictionary
6. Which function is used to check the number of rows and columns in a DataFrame?
a) df.size()
b) df.count()
c) df.shape
d) df.total()
11. The method __________ is used to read a CSV file into a DataFrame.
15. The axis parameter in drop() function is used to specify whether to drop rows or
columns. (______)
19. Write code to create a DataFrame from a dictionary containing the following data:
{'Name': ['Ali', 'Sara'], 'Age': [16, 17], 'Class': ['XI', 'XI']}
24. Explain three different ways to create a Series in pandas with examples.