I have a dataframe with column names ranging from P1 to P10
p1 p2 p3 p4 p5
0 0 0 1 1
0 0 0 0 0
1 1 1 1 1
the total number of 1 has to be displayed at the end of the row
example : first row = 2
second row = 0
third row = 5
df.eq(1).sum(axis=1)