I have a Dataframe that is being output to a spreadsheet called 'All Data'. Let's say this data contains a business addresses (column for street, city, zip, state). However, I also want to create a worksheet for each unique state containing the exact same columns.
My basic idea was to iterate over every row using df.iterrows()
and divide the dataframe like that by appending it to a new dataframe but that seems extremely inefficient. Is there a better way to do this?
I found this answer but that is just a boolean index.