I have a list of locations
[\"HOME\", \"Office\", \"SHOPPING\"]
and a pandas data frame \"DF\"
Start_Location End_Location
I got the answer which I was looking for
import pandas as pd gbl = globals() for i in locations: gbl['df_'+i] = df[df.Start_Location==i]
This will create 3 data frames df_HOME, df_office and df_SHOPPING
Thanks,