FunctionRacerProblemsRace

Swap the Labels

BeginnerpandasPython

staff has columns name and sex, where sex is "m" or "f". Swap them: every "m" becomes "f" and every "f" becomes "m". Return the new sex values as a list, in row order.

Example 1

staff {"name":["a","b","c"],"sex":["m","f","f"]}
returns ["f","m","m"]

f, m, m.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More pandas problems