edebroux / intro-data-capstone-musclehub

0 stars 0 forks source link

Not count but nunique #3

Open sen1 opened 6 years ago

sen1 commented 6 years ago

https://github.com/edebroux/intro-data-capstone-musclehub/blob/6ad8ddd4072ae81cf67414d0ddd68e05383fe39e/Capstone%20Project%202%20De%20Broux/biodiversity.py#L180

You got this earlier, maybe a silly mistake. The correct answer is:

category_counts = species.groupby(['category', 'is_protected'])\
                         .scientific_name.nunique().reset_index()