i have some data like
>>> df1
Col1 Col2
0 Hi Hello
1 How Fine
2 Why Because
3 You Me
4 We They
>>> df2
Col1 Col2
0 Mr Mrs
1 Welcome Bye
2 Wow Ohh
3 Sit Stand
I want to concatenate only the first Column Col1
of these two dataframes and update the df1
leaving Col2
unchanged but i am unable to do it
i tried many ways but failed doing this
Output I want
>>> df2
Col1 Col2
0 Hi Hello
1 How Fine
2 Why Because
3 You Me
4 We They
5 Mr
6 Welcome
7 Wow
8 Sit
It doesnt matter if index is different or there comes NaN instead of Empty Cells
Things i Tried
1
>>> r=pd.concat([df1["Col1"],df2["Col1"]])
>>> df1["Col1"] = r.reset_index(drop=True)
>>> df1
Col1 Col2
0 Hi Hello
1 How Fine
2 Why Because
3 You Me
4 We They
2
>>> pd.concat([df1["Col1"],df2])
0 Col1 Col2
0 Hi NaN NaN
1 How NaN NaN
2 Why NaN NaN
3 You NaN NaN
4 We NaN NaN
0 NaN Mr Mrs
1 NaN Welcome Bye
2 NaN Wow Ohh
3 NaN Sit Stand
3
I Tried append(), merge() and some more techniques but failed