I need to add row value of various columns and store it in same(or new) dataframe. eg: The dataframe looks something like this:
id col1 col2 col3 col4 ... col50
1 1 12 3 44 0
1 7 0 7 2 10
1 2 3 0 4 9
3 9 0 1 0 0
3 1 1 11 1 0
And the expected values should be:
id col1 col2 col3 col4... col50
1 10 15 10 46 19
3 10 1 12 1 0
If I use tmp2 = tmp2.iloc[:,1:50].sum()
, it changes the dimension of the dataframe.