The Python Oracle

Use cumcount on pandas dataframe with a conditional increment

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Over a Mysterious Island

--

Chapters
00:00 Question
01:38 Accepted answer (Score 7)
01:58 Answer 2 (Score 3)
02:13 Answer 3 (Score 2)
02:39 Thank you

--

Full question
https://stackoverflow.com/questions/5101...

Accepted answer links:
[groupby]: http://pandas.pydata.org/pandas-docs/sta...
[shift]: http://pandas.pydata.org/pandas-docs/sta...
[cumsum]: http://pandas.pydata.org/pandas-docs/sta...

Answer 3 links:
[groupby]: http://pandas.pydata.org/pandas-docs/sta...
[shift]: http://pandas.pydata.org/pandas-docs/sta...
[cumsum]: http://pandas.pydata.org/pandas-docs/sta...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #pandas #dataframe #groupby #pandasgroupby

#avk47