1

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 
5
  • You could try charting the log of the count. What's your end goal? Commented Sep 12, 2016 at 17:05
  • My end goal is to normalise the above data in a specific range. Commented Sep 12, 2016 at 17:06
  • 1
    what I mean is why do you want a pie chart? any linear normalization won't change the size of the slices; did you try charting the log of the count? Commented Sep 12, 2016 at 17:07
  • 1
    Normalisation means scaling amounts measured with different scales. It doesn't apply to these data since they are measured on the same scale. A pie chart is not appropriate way of representing these data. Instead a bar-chart with a logarithmic scale is possible, but may be deceptive, or separate G1-12 from the others Commented Sep 12, 2016 at 17:12
  • @user2539738: No I have not tried it still. Is taking a log of count a normalisation technique. Commented Sep 12, 2016 at 17:12

1 Answer 1

3

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) ) 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.