Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
## Check if value exists in series -- correct way
'skim, instant' in dairy_table.Food.values ## call the column values
'skim, instant' in list(dairy_table['Food']) ## convert to a list of values
dairy_table.Food.isin(['skim, instant']).any() ## isin() checks against values
dairy_table['Food'].str.contains('skim, instant').any() ## string method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment