Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Help with building a pie chart that shows aggregate sum of market caps across sectors in notebook

Hello,

I am trying to get more familiar with matplotlib and how to create graphs in Python right now. I am trying to adjust the attached notebook to make the pie chart to display sum, not count and also to understand how to change the bar chart to switch from count to sum. I found the Quantopian Plotting Data lecture helpful, but not in depth enough to tackle the problem I currently have and haven't been able to find any documentation/posts that could help me.

Any help is appreciated, thank you!

1 response

Hi all, I have been working on figuring this out still...

I have tried to break it down into a simpler code/problem so that I can learn the concepts. I want to create a pie chart that shows the aggregate sum of the market cap of companies divided by sector. Where I am struggling is figuring out how to convert/organize the fundamental data so that it is added up correctly. All I can seem to do is add the market cap column in the data frame into an aggregate sum (unable to sort by sector).

What am I missing? Is it even possible to do this? I feel like it should be, but I just don't know how to