Understanding pandas data structures and Python collections
This is a foundational Python and data-analysis question that tests whether you can articulate the structural and behavioural differences between core containers used in quantitative work. Interviewers ask it to confirm you understand when and why to reach for each tool, not just that they exist.
The question probes two related comparisons: how pandas Series and DataFrames differ in dimensionality and use case, and how Python's mutable list contrasts with its immutable tuple. Clear answers distinguish based on shape, mutability, indexing semantics, and performance implications. In practice, quants choose between these based on whether data is one-dimensional or tabular, whether it needs to be modified in place, and whether immutability offers safety or efficiency gains.
- Dimensionality and tabular vs. vector data
- Mutability and when immutability matters
- Indexing: integer position vs. labeled columns
- Memory layout and iteration performance