Informatics Practices

Introduction to Pandas & Matplotlib MCQs | 25 Practice Questions with Answers | CBSE Class 12 Informatics Practices (IP)

Class 12 · Informatics Practices

Introduction to Pandas & Matplotlib MCQs (25 Questions)

Practice these multiple-choice questions to strengthen your understanding of Pandas and Matplotlib. Click Show Answer to reveal the correct answer and explanation.


Q1. Which Python library is primarily used for data analysis and manipulation?

A. NumPy
B. Pandas
C. Matplotlib
D. Turtle

Show Answer

Answer: B. Pandas

Explanation: Pandas is a powerful Python library used for data analysis, manipulation, and handling structured data.


Q2. Which Python library is mainly used for data visualization?

A. Pandas
B. Matplotlib
C. CSV
D. Random

Show Answer

Answer: B. Matplotlib

Explanation: Matplotlib is used to create graphs, charts, and other visual representations of data.


Q3. Which statement correctly imports the Pandas library?

A. import pandas as pd
B. import pandas
C. from pandas import *
D. All of these

Show Answer

Answer: D. All of these

Explanation: All the above statements import Pandas, although import pandas as pd is the most commonly used convention.


Q4. Which statement correctly imports Matplotlib's pyplot module?

A. import matplotlib.pyplot as plt
B. import pyplot
C. import matplotlib
D. import plot

Show Answer

Answer: A.

Explanation: The pyplot module is commonly imported as plt.


Q5. Which of the following are the primary data structures provided by Pandas?

A. List and Tuple
B. Series and DataFrame
C. Dictionary and Set
D. Array and Queue

Show Answer

Answer: B.

Explanation: Pandas mainly provides Series (1D) and DataFrame (2D).


Q6. A Series in Pandas is:

A. Two-dimensional table
B. One-dimensional labeled array
C. Database table
D. Python function

Show Answer

Answer: B.

Explanation: A Series stores one-dimensional labeled data.


Q7. A DataFrame is:

A. One-dimensional array
B. Two-dimensional tabular data structure
C. Stack
D. Queue

Show Answer

Answer: B.

Explanation: A DataFrame stores data in rows and columns.


Q8. Which of the following is TRUE?

A. Series is one-dimensional.
B. DataFrame is two-dimensional.
C. Both are Pandas data structures.
D. All of these.

Show Answer

Answer: D.

Explanation: Series and DataFrame are the two main Pandas data structures.


Q9. Which library is commonly used together with Pandas to create charts?

A. Math
B. Random
C. Matplotlib
D. OS

Show Answer

Answer: C.

Explanation: Matplotlib works with Pandas for data visualization.


Q10. Pandas is mainly used for:

A. Game Development
B. Data Analysis
C. Web Browsing
D. Operating Systems

Show Answer

Answer: B.

Explanation: Pandas provides powerful tools for analyzing and manipulating structured data.


Q11. Which of the following is NOT a Pandas data structure?

A. Series
B. DataFrame
C. Dictionary
D. Panel

Show Answer

Answer: C.

Explanation: Dictionary is a built-in Python data type, not a Pandas data structure.


Q12. Which library is represented using the alias pd?

A. NumPy
B. Pandas
C. Matplotlib
D. CSV

Show Answer

Answer: B.

Explanation: The standard alias for Pandas is pd.


Q13. Which alias is commonly used for Matplotlib's pyplot module?

A. mp
B. pt
C. plt
D. py

Show Answer

Answer: C.

Explanation: plt is the standard alias for matplotlib.pyplot.


Q14. Which of the following can be represented using a DataFrame?

A. Student marks table
B. Employee records
C. Sales report
D. All of these

Show Answer

Answer: D.

Explanation: DataFrames are suitable for storing tabular data.


Q15. Which type of data is Pandas mainly designed to handle?

A. Structured Data
B. Audio Files
C. Video Files
D. Animation

Show Answer

Answer: A.

Explanation: Pandas is designed for structured, tabular data.



Q16. Which Pandas data structure is most suitable for storing marks of a single subject for different students?

A. Series
B. DataFrame
C. Dictionary
D. Tuple

Show Answer

Answer: A. Series

Explanation: A Series stores one-dimensional labeled data, making it suitable for storing marks of a single subject.


Q17. A school wants to store students' Name, Roll Number, Class, and Percentage. Which Pandas data structure should be used?

A. Series
B. DataFrame
C. List
D. Set

Show Answer

Answer: B. DataFrame

Explanation: A DataFrame can store multiple columns of different data types in tabular form.


Q18. Which library is commonly used with Pandas to create line graphs, bar charts, and pie charts?

A. NumPy
B. Matplotlib
C. Random
D. OS

Show Answer

Answer: B. Matplotlib

Explanation: Matplotlib is the standard plotting library used with Pandas.


Q19. Which of the following statements about a Series is TRUE?

A. It stores data in rows and columns.
B. It is a one-dimensional labeled array.
C. It can store only integer values.
D. It cannot have an index.

Show Answer

Answer: B.

Explanation: A Series is a one-dimensional labeled array that can store different types of data.


Q20. Which statement about a DataFrame is TRUE?

A. It contains only one column.
B. It is always one-dimensional.
C. It is a two-dimensional labeled data structure.
D. It cannot contain text data.

Show Answer

Answer: C.

Explanation: A DataFrame stores data in rows and columns and can contain multiple data types.


Q21. Which of the following is an application of Pandas?

A. Student result analysis
B. Sales report preparation
C. Employee data management
D. All of these

Show Answer

Answer: D. All of these

Explanation: Pandas is widely used for storing, processing, and analyzing tabular data.


Q22. Which of the following is an application of Matplotlib?

A. Creating graphs and charts
B. Writing SQL queries
C. Creating databases
D. Managing operating systems

Show Answer

Answer: A.

Explanation: Matplotlib is used to create various types of data visualizations.


Q23. Which of the following is the correct combination?

A. Pandas → Data Analysis
B. Matplotlib → Data Visualization
C. Series → One-dimensional Data Structure
D. All of these

Show Answer

Answer: D. All of these

Explanation: Each statement correctly describes the purpose of the respective library or data structure.


Q24. A DataFrame is most similar to:

A. A spreadsheet table
B. A single variable
C. A tuple
D. A stack

Show Answer

Answer: A.

Explanation: A DataFrame organizes data into rows and columns like a spreadsheet.


Q25. Which statement best summarizes Pandas and Matplotlib?

A. Pandas is used for data manipulation and analysis.
B. Matplotlib is used for graphical representation of data.
C. Both libraries are widely used together in Data Science and Data Analysis.
D. All of these.

Show Answer

Answer: D. All of these.

Explanation: Pandas and Matplotlib complement each other—Pandas manages and analyzes data, while Matplotlib visualizes it using charts and graphs.


Answer Key

Q.No. Answer Q.No. Answer Q.No. Answer
1B11C21D
2B12B22A
3D13C23D
4A14D24A
5B15A25D
6B16A
7B17B
8D18B
9C19B
10B20C

Practice Tips

  • Remember the purpose of each library:
    • Pandas → Data Analysis & Data Manipulation
    • Matplotlib → Data Visualization (Charts & Graphs)
  • Differentiate between the two main Pandas data structures:
    • Series → One-dimensional labeled array.
    • DataFrame → Two-dimensional tabular data with rows and columns.
  • Memorize the commonly used import statements:
    • import pandas as pd
    • import matplotlib.pyplot as plt
  • Applications of Pandas include:
    • Student Result Analysis
    • Employee Records
    • Sales Analysis
    • Weather Data Analysis
    • Business Reports
  • Applications of Matplotlib include:
    • Line Charts
    • Bar Charts
    • Pie Charts
    • Histograms
    • Scatter Plots
  • CBSE Tip: Competency-based questions often test the difference between Series and DataFrame, as well as the purpose of Pandas and Matplotlib. Focus on understanding these concepts rather than memorizing definitions.