Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python pandas in list

# Dataframe df column 'columnA' is any of the values 'value1', 'value2'
df[df['columnA'].isin(['value1', 'value2'])]['columnB']
# SQL equivalent:
SELECT columnB FROM df WHERE columnA IN ('value1', 'value2')
 
PREVIOUS NEXT
Tagged: #python #pandas #list
ADD COMMENT
Topic
Name
7+9 =