Create multiple dataframe using for loop in python 2.7

后端 未结 3 699
余生分开走
余生分开走 2021-01-26 01:00

I have a list of locations

[\"HOME\", \"Office\", \"SHOPPING\"]

and a pandas data frame \"DF\"

Start_Location  End_Location            


        
3条回答
  •  情书的邮戳
    2021-01-26 01:36

    You could probably have a dictionary and you want to convert it to some dataframes, based on the keys of your dictionary:

    gbl = globals()
    for keys, values in dictionary.items():
       gbl['df_min'+ str(keys)] = pd.DataFrame(values)
    

提交回复
热议问题