Chapter-1 Data Handling using Pandas - I — Online MCQ Test
INFORMATICS PRACTICES · Grade 12 · CBSE(NCERT)
Practice Chapter-1 Data Handling using Pandas - I with a free chapter-wise online MCQ test.
This chapter covers: Pandas - Series - DataFrame - dictionaries - lists - ndarray - indexing.
AI-generated questions from basic to board-exam level, with instant results and explanations.
Chapter-1 Data Handling using Pandas - I — Important Questions & Answers
Which of the following is the primary data structure in Pandas used to handle one-dimensional labeled data?
- A. Series
- B. DataFrame
- C. ndarray
- D. Dictionary
Answer: A. Series
A Pandas Series is a one-dimensional labeled array capable of holding any data type, with an associated index for labeling.
A Pandas Series is a one-dimensional labeled array capable of holding any data type, with an associated index for labeling.
What does 'ndarray' stand for in NumPy?
- A. Named data array
- B. N-dimensional array
- C. Numeric data array
- D. New dimensional array
Answer: B. N-dimensional array
ndarray stands for N-dimensional array, which is the fundamental data structure in NumPy for storing homogeneous numerical data.
ndarray stands for N-dimensional array, which is the fundamental data structure in NumPy for storing homogeneous numerical data.
In Pandas, how can you access a single element from a Series using label-based indexing?
- A. Using square brackets with integer position
- B. Using the iloc[] method
- C. Using square brackets with the label
- D. Using the at[] method
Answer: C. Using square brackets with the label
Label-based indexing in Pandas uses square brackets with the label (index) to access specific elements: series['label'].
Label-based indexing in Pandas uses square brackets with the label (index) to access specific elements: series['label'].
What is the primary advantage of using Pandas over Python lists for data manipulation?
- A. Lists are always faster
- B. Pandas provides labeled indexing, vectorized operations, and built-in data analysis functions
- C. Lists can handle larger datasets
- D. Pandas requires less memory
Answer: B. Pandas provides labeled indexing, vectorized operations, and built-in data analysis functions
Pandas provides labeled data access, vectorized operations without loops, and integrated statistical and data manipulation functions unavailable in basic lists.
Pandas provides labeled data access, vectorized operations without loops, and integrated statistical and data manipulation functions unavailable in basic lists.
In a competitive exam scenario, a student needs to select specific rows from a DataFrame where a condition is true. Which approach is most efficient?
- A. Using a for loop to check each row
- B. Boolean indexing: df[df['column'] > threshold]
- C. Using .filter() method with string patterns
- D. Converting to list and filtering manually
Answer: B. Boolean indexing: df[df['column'] > threshold]
Boolean indexing with vectorized conditions is the most efficient and Pythonic way to filter DataFrame rows, leveraging Pandas' optimized operations.
Boolean indexing with vectorized conditions is the most efficient and Pythonic way to filter DataFrame rows, leveraging Pandas' optimized operations.