Concatenate a list of pandas dataframes together

自古美人都是妖i 提交于 2019-11-27 17:55:42

Given that all the dataframes have the same columns, you can simply concat them:

import pandas as pd
df = pd.concat(list_of_dataframes)
meyerson

If the dataframes DO NOT all have the same columns try the following:

df = pd.DataFrame.from_dict(map(dict,df_list))

You also can do it with functional programming:

reduce(lambda df1, df2: df1.merge(df2, "outer"), mydfs)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!