kgereb / intro-to-data-analysis

0 stars 0 forks source link

Great lambda #3

Open Caealana opened 6 years ago

Caealana commented 6 years ago

https://github.com/kgereb/intro-data-capstone-biodiversity/blob/7e6cde43eeba4d9c59e46e75a35806120bff706b/Capstone_kgereb/Python.py#L113-L114

Your lambda is formatted correctly and accomplishes the task. I'll leave for reference another method that can be used to set the No Intervention rows:

species['is_protected'] = species.conservation_status != 'No Intervention'

This code takes the whole conservation_status column and compares each value to 'No Intervention'. It creates a series of True and False boolean values depending on the results from each comparison.