Skip to content

Commit 1faed20

Browse files
Fixes error in challege - plots
Fixes #639
1 parent 535175e commit 1faed20

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

episodes/02-starting-with-data.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,11 +750,14 @@ total_count.plot(kind='bar');
750750

751751
::::::::::::::::::::::: solution
752752

753-
1. `surveys_df.groupby('plot_id').mean()["weight"].plot(kind='bar')`
753+
1.
754+
`surveys_df.groupby('plot_id').mean(numeric_only='True')['weight'].plot(kind='bar')`
755+
Or
756+
`surveys_df.groupby('plot_id')['weight'].mean().plot(kind='bar')`
754757

755758
![](fig/01_chall_bar_meanweight.png){alt='average weight across all species for each plot'}
756759

757-
2. `surveys_df.groupby('sex').count()["record_id"].plot(kind='bar')`
760+
2. `surveys_df.groupby('sex').count()['record_id'].plot(kind='bar')`
758761

759762
![](fig/01_chall_bar_totalsex.png){alt='total males versus total females for the entire dataset'}
760763

0 commit comments

Comments
 (0)