How do I perform pandas cumsum while skipping rows that are duplicated in another field?
I am trying to use the pandas.cumsum() function, but in a way that ignores rows with a value in the ID column that is duplicated and specifically only adds the last value to the cumulative sum, ignoring all earlier values.
Example code below (I couldn’t share the real code, which is for work).
How to perform pandas cumsum while skipping rows which are duplicated in another field
I am trying to use the pandas.cumsum() function but in a way that ignores rows with a value in the ID column which is duplicated, and specifically only add the last value to the cumulative sum, ignoring all earlier values.
Example code below (I couldn’t share real code which is for work).