Swap the Labels
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
- The tables are small
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More pandas problems
- Table ShapeBeginner
- Top ScoresBeginner
- Upper QuartileBeginner
- Wanted StatusesBeginner
- Add Total ColumnEasy
- All Emails OnceEasy
- Biggest Single NumberEasy
- Cheapest ItemEasy