Unit 9: Handling data with pandas - Subjective Questions

ECAP776 • Practice Questions with Detailed Answers

20 questions

1

Define pandas and explain its importance in Python data analysis.

2

Describe the principal data structures provided by pandas.

3

What is a pandas Series? Explain different ways of creating a Series with examples.

4

Explain indexing and slicing in a pandas Series. Distinguish between loc and iloc.

5

Describe arithmetic operations and index alignment in pandas Series.

6

Define a pandas DataFrame and explain how it can be created from dictionaries, lists, and Series.

7

Explain how rows and columns are selected from a DataFrame using bracket notation, loc, and iloc.

8

Explain how columns and rows can be added, modified, renamed, and deleted in a DataFrame.

9

Describe the attributes and methods used to inspect the structure and contents of a DataFrame.

10

Differentiate between sort_values() and sort_index() in pandas, with suitable examples.

11

Explain multi-column sorting and the treatment of missing values while sorting a DataFrame.

12

What is a CSV file? Describe how read_csv() is used to load CSV data into a DataFrame.

13

Explain how a DataFrame is written to a CSV file. Why is index=False commonly used?

14

Describe a complete procedure for reading, validating, cleaning, sorting, and saving student data stored in a CSV file.

15

Explain Boolean filtering in a DataFrame. How can multiple conditions be combined?

16

Explain common statistical and aggregation operations performed on DataFrame columns.

17

Describe how missing data is identified and handled in pandas. Compare dropna() and fillna().

18

Explain grouping and aggregation in pandas using groupby(). Include an example with more than one aggregation.

19

Compare vectorized DataFrame operations, apply(), and explicit Python loops.

20

A DataFrame contains the columns Name, Math, Science, and English. Describe pandas operations to calculate totals and percentages, assign results, filter successful students, and rank them.