I have a pandas Dataframe y with 1 million rows and 5 columns.
np.shape(y) (1037889, 5)
The column values ββare all 0 or 1. The expression looks something like this:
y.head() a, b, c, d, e 0, 0, 1, 0, 0 1, 0, 0, 1, 1 0, 1, 1, 1, 1 0, 0, 0, 0, 0
I want a Dataframe with 1 million rows and 1 column.
np.shape(y) (1037889, )
where a column is only 5 columns combined together.
New column 0, 0, 1, 0, 0 1, 0, 0, 1, 1 0, 1, 1, 1, 1 0, 0, 0, 0, 0
I keep trying different things like merge , concat , dstack , etc .... but can't figure it out.
python merge numpy pandas concatenation
Neck beard
source share