I have a Data Frame df0 with n columns. Only one of the columns contains a row, all other columns are empty or contain the string "".
Is it possible to collapse a data frame into a data frame with one column, where for each row I get a non-empty element?
df0:
A B C
1 Car
2 Car
3 Bike
4 Car
5 Train
6 Train
should give:
1
1 Car
2 Car
3 Bike
4 Car
5 Train
6 Train
source
share