x == 'No Intervention' returns a boolean output. So adding another if statement does not make much sense. Although you would want the opposite of x == 'No Intervention', so just do x != 'No Intervention':
species['is_protected'] = species.conservation_status.apply(lambda x: x != 'No Intervention')
https://github.com/edebroux/intro-data-capstone-musclehub/blob/6ad8ddd4072ae81cf67414d0ddd68e05383fe39e/Capstone%20Project%202%20De%20Broux/biodiversity.py#L171
x == 'No Intervention'
returns a boolean output. So adding another if statement does not make much sense. Although you would want the opposite ofx == 'No Intervention'
, so just dox != 'No Intervention'
:even a better way is this: