pandas || 3 lines, apply || T/S: 99% / 97%
\nimport pandas as pd\n\ndef swap_salary(salary: pd.DataFrame) -> pd.DataFrame:\n\n    swap = lambda x: \'m\' if x == \'f\' else \'f\'\n    salary[\'sex\'] = sa
```\nimport pandas as pd\n\ndef swap_salary(salary: pd.DataFrame) -> pd.DataFrame:\n\n    swap = lambda x: \'m\' if x == \'f\' else \'f\'\n    salary[\'sex\'] = salary.sex.apply(swap)\n\n    return salary\n```\n\n[https://leetcode.com/problems/swap-salary/submissions/1259046148/](https://leetcode.com/problems/swap-salary/submissions/1259046148/)\n\nI could be wrong, but I think that time complexity is *O*(*N*)  and space complexity is *O*(1), in which *N* ~ `len(salary)`
['Pandas']