When should you use .apply(), .map() or .applymap() in pandas, and how do they compare with vectorized code?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
Overview: Asks when to use the pandas methods apply(), map() and applymap(), and how their speed compares with vectorized operations. Tests whether you know what each method passes to your function, where the per-call cost comes from, and how to rewrite slow element-wise or row-wise code.