I have two dataframes of different lengths.
Column1 Column2 ColumnA ColumnG ColumnSG 0 ab1 bc1 ab1 A AA 1 ab2 ab5 bc1 B BB 2 ab3 bc4 ab3 C CC 3 ab4 ab5 ab1 D DD 4 ab5 ab1 ab5 E EE bc4 F FF ab2 G GG ab4 H HH
I would like an output that looks something like this:
What I tried so far?
for row in df1, df2: if df1[Column1] == df2[ColumnA]: df1[ColumnG1] = df2[ColumnG] df1[ColumnSG1] = df2[ColumnSG]
But, this gave me an error saying,
ValueError: Can only compare identically-labeled Series objects
How can I solve this?