DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
pandas filter dataframe if an elemnt is in alist
In [30]: df[df['id'].isin(['foo','bar'])] Out[30]: value id 0 1 foo 1 2 bar
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#pandas
#filter
#dataframe
#elemnt
#alist
ADD COMMENT
Topic
COMMENT
Name
1+6 =
Submit