Open cyouh95 opened 6 years ago
You could simplify this line:
https://github.com/fabriciodisalvo/biodiversity_codecademy/blob/8cdccdb15906229f11a9467d480a1143575dcc57/biodiversity.py#L311
to:
species['is_sheep'] = species.common_names.apply(lambda x: 'Sheep' in x)
'Sheep' in x itself would resolve to either True or False, which would be returned in the lambda function.
'Sheep' in x
True
False
You could simplify this line:
https://github.com/fabriciodisalvo/biodiversity_codecademy/blob/8cdccdb15906229f11a9467d480a1143575dcc57/biodiversity.py#L311
to:
'Sheep' in x
itself would resolve to eitherTrue
orFalse
, which would be returned in the lambda function.