@@ -374,7 +374,7 @@ array(['NL', 'DM', 'PF', 'PE', 'DS', 'PP', 'SH', 'OT', 'DO', 'OX', 'SS',
374374>
375375> 2. Is there a simpler solution for doing this?
376376>
377- <!-- > > ## Solution
377+ > > ## Solution
378378> >
379379> > ~~~
380380> > # 1
@@ -387,7 +387,7 @@ array(['NL', 'DM', 'PF', 'PE', 'DS', 'PP', 'SH', 'OT', 'DO', 'OX', 'SS',
387387> > {: .python}
388388> >
389389> > Note that the `.nunique()` method does not count null (i.e., `nan`) values.
390- > {: .solution} -->
390+ > {: .solution}
391391{: .challenge}
392392
393393
@@ -544,13 +544,13 @@ summaries of categorical data.
544544> Using the `.describe()` method on the DataFrame sorted by sex,
545545> determine how many individuals were observed for each.
546546>
547- <!-- > > ## Solution
547+ > > ## Solution
548548> >
549549> > * *Female* = 15690
550550> >
551551> > * *Male* = 17348
552552> >
553- > {: .solution} -->
553+ > {: .solution}
554554{: .challenge}
555555
556556
@@ -561,29 +561,29 @@ summaries of categorical data.
561561> then view mean values:
562562> - Hint: you can use a list in the arguments of the `.groupby()` method, `['plot_id','sex']`
563563>
564- <!-- > > ## Solution
564+ > > ## Solution
565565> >
566566> > ~~~
567567> > sorted_data2 = surveys_df.groupby(['plot_id','sex'])
568568> > sorted_data2.mean()
569569> > ~~~
570570> > {: .python}
571- > {: .solution} -->
571+ > {: .solution}
572572{: .challenge}
573573
574574
575575> ## Summarize a single column
576576>
577577> Summarize weight values for each plot in your data.
578578>
579- <!-- > > ## Solution
579+ > > ## Solution
580580> >
581581> > ~~~
582582> > by_plot = surveys_df.groupby('plot_id')
583583> > by_plot['weight'].describe()
584584> > ~~~
585585> > {: .python}
586- > {: .solution} -->
586+ > {: .solution}
587587{: .challenge}
588588
589589
@@ -702,7 +702,7 @@ total_count.plot(kind='bar',title='Number captured per plot', color='green')
702702> Create a bar plot that shows the average weight of all of the animals captured in that plot.
703703> Also, choose an interesting or pleasing color from the list of [named web colors](https://en.wikipedia.org/wiki/Web_colors).
704704>
705- <!-- > > ## Solution
705+ > > ## Solution
706706> >
707707> > ~~~
708708> > plot_weight_means = surveys_df.groupby('plot_id')['weight'].mean()
@@ -711,22 +711,22 @@ total_count.plot(kind='bar',title='Number captured per plot', color='green')
711711> > {: .python}
712712> >
713713> > 
714- > {: .solution} -->
714+ > {: .solution}
715715{: .challenge}
716716
717717> ## Plot the number of females and the number of males in the dataset
718718>
719719> Create a bar plot that shows the total number of each sex captured for the entire dataset.
720720>
721- <!-- > > ## Solution
721+ > > ## Solution
722722> >
723723> > ~~~
724724> > counts_by_sex = surveys_df['record_id'].groupby(surveys_df['sex']).count()
725725> > counts_by_sex.plot(kind='bar',title='Number captured for each sex',color=['k', 'r'])
726726> > ~~~
727727> > {: .python}
728728> >
729- > >  -->
729+ > > 
730730> {: .solution}
731731{: .challenge}
732732
0 commit comments