I would like to make a graph to show the proportion p of each element of a df.groupby
result.
My data looks like this:
I would like to display a bar plot, using the df_country
data.
for the country CH : p = 920/tot, DE : p = 3/tot, US : p= 287 321/ tot
with tot = sum of all elements : 920 + 3 + 287 321 = 288 244
I need to do the same with df_unit
. Do I need a loop to do this, or can a simple function help me ?