I have a list with dataframes. I want to merge every 6 dataframes. The way I m doing it is very manual, so I am doing:
from functools import reduce
import paandas as pd
list1 = bigList[0:5]
list1DF = reduce(lambda df1,df2: pd.merge(df1,df2,on='index', how = 'outer'), list1)
list2 = bigList[6:11]
list2DF = reduce(lambda df1,df2: pd.merge(df1,df2,on='index', how = 'outer'), list2)
and so on, until I merge all of them and then concat,
full_df = pd.concat([list1DF, list2DF, ...])
Any tips as to how I can automate this?