What are the key features of the Pandas library?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
What are the key features of the pandas library? Describe its main data structures and the kinds of work it is used for in a typical data analysis workflow.
```hint Organize the answer
Start with the data structures and what the index gives you, then walk through the steps of an analysis: loading, cleaning, combining, aggregating and writing out.
```
### What a Strong Answer Covers
- The two core data structures and the role of the index
- Label-based alignment, including what happens to labels that appear in only one operand
- The main families of operations: I/O, missing data and cleaning, merging and reshaping, group-by aggregation, and time series
- Vectorized operations built on NumPy, and why row-by-row Python loops are slow
### Follow-up Questions
- What is the difference between `loc` and `iloc`, and when does it matter?
- Why can `df[df.x > 0]["y"] = 0` leave `df` unchanged, and how should that assignment be written?
- How does pandas represent a missing value in an integer column?
- When would you move from pandas to a tool such as Polars, DuckDB or Spark?
Overview: Asks for the main features of the pandas library for data analysis in Python. Tests familiarity with Series and DataFrame, index alignment, file I/O, missing data handling, merging and reshaping, group-by aggregation and time-series tools.