Home > Enterprise >  analogy of SUMIFS in Excel function in Pandas
analogy of SUMIFS in Excel function in Pandas

Time:10-23

I have a difficulty with applying Excel SUMIFS type function in Pandas. I have a table similar to one on picture. I need to find Sum of each product sold each day. But I don't need it in Summary table. I need it to be written in column next to each one as shown in red column. In excel I'm using SUMIFS function. But in Pandas I can't find any analogy. Once again, I don't need just count/or sum as shown summary in another table. I need it be near each entry in new column. Is there any way I can do it? P.S VERY Important thing- Writing with group by where I will need to write each condition isn't a solution. Because I want it to show next to each cell. In my data there will be thousands of entries and I don't know each entry to write =="apple", =="orange" each time. I need the same logic as in Excel. Sold that day column created

In your words, we often use groupby to create "summaries" or aggregations. But transform is also useful to know since it allows us to splat the result back into the data frame it came from, just like in your example.

  • Related