I'm trying to add a new column to a dataframe, and fill up that column with multiple other columns in the dataframe concatenated together. How can I do this with the fact that this new column will have a different length than the rest of the columns in the dataframe?
For example:
df = pd.DataFrame([[1, 2], [1, 3], [4, 6]], columns=['A', 'B'])
I would want to create a column C in the dataframe that reads 1,1,4,2,3,6 (except vertically)
print (df)
A B C
0 1 2 1
1 1 3 1
2 4 6 4
3 2
4 3
5 6