DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
pandas groupby get all but first row
df
[
~
df
.
index
.
isin
(
df
.
groupby
(
'ID'
)
.
head
(
1
)
.
index
)
]
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#pandas
#groupby
#row
ADD COMMENT
Topic
COMMENT
Name
6+1 =
Submit