df_top4
as below
I have a dataframe (df_top4
) as below and I want to divide the entire row by total, without dividing it by itself. Is there a way I could preserve my total as I need to make a bar chart of subject vs
total?
df_top4=df_top4.divide(df_top4.total, axis=0)
Also I want to retain the total field hence this olution(Pandas sum across columns and divide each cell from that value) didnt work