I have 2 dataframes of size 31789x7 and 31789x3. I want to create a 31789x10 dataframe. This works in principle with
df3 = pd.concat([df1, df2], axis=1)
for artificial data in half a second. But on my data the concat does not finish within 10 min. If I do it "manually" with:
for c in df2:
df1[c] = df2[c]
it crashed with:
ValueError: cannot reindex from a duplicate axis
What is the problem here? (ignore_index=True does not help)
pd.concatis taking a long time? Or that your for loop is throwing an error? In either event a Minimal Complete Verifiable Example would help!