user3447653
user3447653

Reputation: 4148

Normalisation of data

I am trying to plot the data below in a pie chart. I split the pie chart based on the group first and then based on the Id. But since for some rows, the count is very small, I am not able to see it in the pie chart.

I am trying to normalise the data. I am not sure on how to do that. Any help would be sincerely appreciated.

 Group     Id      Count
 G1        12      276938
 G1        13      102
 G2        12      27
 G3        12      4683
 G3        13      7
 G4        12      301

Upvotes: 1

Views: 408

Answers (1)

Zeugma
Zeugma

Reputation: 32095

Don't pie chart what doesn't fit a visual representation in a pie chart

(
    df.groupby(['Group', 'Id'])
    .sum().Count.sort_values(ascending=False)
    .plot.bar(logy=True, subplots=True)
)

Upvotes: 3

Related Questions