df = pd.DataFrame({"Bye":[1,42,35,5],"c":[1,2,3,3],"d":[1,2,6,3],"f":[1,2,3,3],"e":[1,4,3,3]})
# output
Bye c d f e
0 1 1 1 1 1
1 42 2 2 2 4
2 35 3 6 3 3
3 5 3 3 3 3
df.iloc[:,2:].mode(axis=1)
#output
0
0 1
1 2
2 3
3 3
First locate the elements on which you want to extract/calculate the mode.
df.iloc[:,2:] means we are going to take all the rows from the df and only the columns starting from 2+. Then we apply the mode and select axis=1 to calculate over the rows.
Axis in pandas

Multiple Modes
df77 = pd.DataFrame({"Bye":[1,42,35,5],"c":[1,42,3,3],"d":[2,7,6,3],"f":[2,7,3,3],"e":[3,4,3,3]})
df77
Bye c d f e
0 1 1 2 2 3
1 42 42 7 7 4
2 35 3 6 3 3
3 5 3 3 3 3
all_modes = df77.mode(axis=1)
all_modes.columns = ["mode1","mode2"] #renaming the modes because some rows had multiple ones
mode1 mode2
0 1.0 2.0
1 7.0 42.0
2 3.0 NaN # indicates only 1 mode found
3 3.0 NaN
pd.concat([df77,all_modes],axis=1)
Bye c d f e mode1 mode2
0 1 1 2 2 3 1.0 2.0
1 42 42 7 7 4 7.0 42.0
2 35 3 6 3 3 3.0 NaN
3 5 3 3 3 3 3.0 NaN