Open sen1 opened 6 years ago
https://github.com/tylerponticelli/intro-data-capstone-biodiversity/blob/3b4ea4fbd6679feba67bfeedb3ac77e0f110c9f4/codeacademy/readme.txt#L112-L114
I am not sure you can use in on a dataframe. I would do:
in
species['is_sheep'] = species.common_names.apply(lambda x: 'Sheep' in x)
This also saves you the axis=1 argument because you are using apply function to a pandas series object, not to a dataframe.
axis=1
https://github.com/tylerponticelli/intro-data-capstone-biodiversity/blob/3b4ea4fbd6679feba67bfeedb3ac77e0f110c9f4/codeacademy/readme.txt#L112-L114
I am not sure you can use
in
on a dataframe. I would do:This also saves you the
axis=1
argument because you are using apply function to a pandas series object, not to a dataframe.