I have a pandas data frame like this:
Column1 Column2 Column3 Column4 Column5 0 a 1 2 3 4 1 a 3 4 5 2 b 6 7 8 3 c 7 7
Now I want to get a new dataframe containing Column1 and a new column A. This column A should contain all the values โโfrom columns 2 - (to) n (where n is the number of columns from column 2 to the end of the row), for example:
Column1 ColumnA 0 a 1,2,3,4 1 a 3,4,5 2 b 6,7,8 3 c 7,7
How could I best approach this issue? Any advice would be helpful. Thanks in advance!
python list pandas dataframe row
sequence_hard
source share