1

I have been using this code to merge multiple Pandas dataframes in Python:

import pandas as pd from functools import reduce dfs = [df1, df2, df3, df4, df5] df_final = reduce(lambda left, right: pd.merge(left, right, on='date'), dfs) 

It is now giving me this error:

TypeError: Can only merge Series or DataFrame objects, a <class 'list'> was passed 

How could I fix this?

0

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.