Pythonic way to associate list of dataframes to list of strings

后端 未结 3 1794
花落未央
花落未央 2021-01-29 09:07

In encountered this problem when converting a json object to a csv:

I now have two lists:

list_A is a list of strings. Each string is a name of df.



        
3条回答
  •  滥情空心
    2021-01-29 09:29

    You can associate them with a dict:

    df_dict = dict(zip(list_A, list_B))
    
    df_dict['df1'].head() ## Returns the first 10 rows of list_B[0]
    

提交回复
热议问题