When would you use df.apply(..., axis=1) for row-wise operations, and what are its performance implications?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Asks when a row-wise pandas apply with axis=1 is the right tool and what it costs in speed. Tests whether you understand the performance cost of row-wise apply compared with column operations, and which vectorized NumPy and pandas operations can replace it.