Skip to content
Advertisement

How to sum a value based on group?

I am trying to figure out how to sum a value from rank 5 to the LOWEST rank (I.E. 5-1,000) for each geography in my dataframe.

JavaScript

However, I am getting the error: ‘DataFrameGroupBy’ object has no attribute ‘iloc’

Am I using iloc incorrectly?

Advertisement

Answer

IIUC, try:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement