How do you stack two Pandas Dataframe columns on top of each other?
问题 Is there a library function or correct way of stacking two Pandas data frame columns on top of each other? For example make 4 columns into 2: a1 b1 a2 b2 1 2 3 4 5 6 7 8 to c d 1 2 5 6 3 4 7 8 The documentation for Pandas Data Frames that I read for the most part only deal with concatenating rows and doing row manipulation, but I'm sure there has to be a way to do what I described and I am sure it's very simple. Any help would be great. 回答1: You can select the first two and second two columns