About Pandas Aggregate Func

My question is about the aggregate functions of Pandas library. Let’s say I have a table of the items sold in a market. How can I learn how much an item is sold? df.column_name.max() function gives me the name of the item. I think I will use the count() function but I need help. Thanks!

Hey @system1981794380, welcome to the forums! In order to answer your question, we’ll need to see your code and also a link to the exercise :slight_smile: Here’s a set of guides on how to get helpful answers.

2 Likes

That was a random question that occurred to me. I tried to write a case :slight_smile: Is it not clear? Thanks btw

1 Like

Do you have any code to post? A link to Github, perhaps? What have you tried so far?

Depending on how your df is set up, you can subtract one col from the other if you have a col that has inventory and another col that has number sold. You would have to create a new col. w/the results. Check this out:
https://stackoverflow.com/questions/48350850/subtract-two-columns-in-dataframe

`still trying to learn hope I can get through this :slightly_smiling_face:

I’m not sure what the data looks like, but I imagine you’ll need something like:

df.groupby('item').count()