I have a sample dataframe1
City Employee Manager email date
Florida city XYZ ABC [email protected] 2021-03-01
Huston XYZ ABC [email protected] 2021-03-02
Miami city MNO ABC [email protected] 2021-03-01
Washington DC KLM XYZ [email protected] 2021-03-01
Pittsburg EFG XYZ [email protected] 2021-03-01
California HIJ XYZ [email protected] 2021-03-01
How do I iterate through the manager column in such a way that rows/data of one manager should be saved in excel and the rows/data of another manager should be saved in another excel?
desired result
first excel data (filename: ABC - XYZ, MNO)
city | employee | manager | email | date
-------------------------------------------------------------------------------
Florida city | XYZ | ABC | [email protected] | 2021-03-01
Huston | XYZ | ABC | [email protected] | 2021-03-02
Miami city | MNO | ABC | [email protected] | 2021-03-01
second excel data (filename: XYZ - KLM, EFG, HIJ)
city | employee | manager | email | date
---------------------------------------------------------------------------
Washington DC | KLM | XYZ | [email protected] | 2021-03-01
Pittsburg | EFG | XYZ | [email protected] | 2021-03-01
California | HIJ | XYZ | [email protected] | 2021-03-01