I have two dataframes with n number of common columns. There are 48 columns in the first and 56 columns in the other one. I'm trying to concat these columns vertically using pd.concat and I'm always getting the following error Reindexing only valid with uniquely valued Index objects.
df1
Column 1 | Column 2 | Column3 |
---|---|---|
a | b | c |
df2
Column 1 | Column 3 | Column 2 | Column 5 | Column 6 | Column 7 |
---|---|---|---|---|---|
a | b | c | a | Nan | c |
I want to concat this vertically. But I get the following error Reindexing only valid with uniquely valued Index objects.
Merged_Data = pd.concat([Merged_Data,df] , join = "outer", ignore_index = True).reset_index(drop = True)
It's a huge dataframe and can't share it due to security reasons. I believe the problem lies in the column indexing but I have tried a lot of things