Kinda new to pandas but coding something to help a friend of mine automate some tasks..
I have a rather large database, of which I would like to append two specific columns with another database. The issue is that the second database is not of the same dimension (2xN), while the first database is of something like (8xM). For simplicity let's say
d1 = pandas.pd.DataFrame({"A": [1,2,3], "B": [2,3,4], "C":[3,2,1]})
while
d2 = pandas.pd.DataFrame({"A": [0,1], "B": [2,4]})
Now I would like to append d2 to d1 while C can be appended with NaN or something, so that the result is
A B C
1 2 3
2 3 4
3 3 1
0 2 NaN
1 4 NaN
Where the indices should be numbered. The issue is that I'd like to do this without adding columns to d2 beforehand, since this can very from file to file..
Any help is much appreciated!
Cheers!