The Python Oracle

Pandas creating new column based on consecutive duplicates

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: Cosmic Puzzle

--

Chapters
00:00 Question
00:57 Accepted answer (Score 2)
01:54 Answer 2 (Score 2)
02:08 Answer 3 (Score 0)
02:21 Thank you

--

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

Accepted answer links:
[groupby ngroup]: https://pandas.pydata.org/docs/reference...
[cumsum]: https://pandas.pydata.org/docs/reference...

--

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

--

Tags
#python #pandas #numpy #boolean #shift

#avk47