Last active
September 21, 2020 02:57
-
-
Save YiLi225/b4d0442e32e122d6989a16fc18ca6c88 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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