How do you apply a function element-wise to a column in a DataFrame?
Instruction: Demonstrate the use of the 'apply' method to transform the data of a column in Pandas.
Context: This question assesses the candidate's familiarity with data transformation techniques in Pandas, crucial for feature manipulation and data cleaning.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
A scalar callable passed to Series.apply can transform each value. Define its missing-value and input-domain behavior...