@@ -322,7 +322,7 @@ of all of the column names in our DataFrame.
322322> ~~~
323323> {: .python}
324324>
325- > Print the shape of the DataFrame
325+ > Print the dimensions of the DataFrame
326326>
327327> ~~~
328328> surveys_df.shape
@@ -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
@@ -701,7 +701,7 @@ total_count.plot(kind='bar',title='Number captured per plot', color='green')
701701> Create a bar plot that shows the average weight of all of the animals captured in that plot.
702702> Also, choose an interesting or pleasing color from the list of [named web colors](https://en.wikipedia.org/wiki/Web_colors).
703703>
704- > > ## Solution
704+ <!-- > > ## Solution
705705> >
706706> > ~~~
707707> > plot_weight_means = surveys_df.groupby('plot_id')['weight'].mean()
@@ -710,14 +710,14 @@ total_count.plot(kind='bar',title='Number captured per plot', color='green')
710710> > {: .python}
711711> >
712712> > 
713- > {: .solution}
713+ > {: .solution} -->
714714{: .challenge}
715715
716716> ## Plot the number of females and the number of males in the dataset
717717>
718718> Create a bar plot that shows the total number of each sex captured for the entire dataset.
719719>
720- > > ## Solution
720+ <!-- > > ## Solution
721721> >
722722> > ~~~
723723> > counts_by_sex = surveys_df['record_id'].groupby(surveys_df['sex']).count()
@@ -726,7 +726,7 @@ total_count.plot(kind='bar',title='Number captured per plot', color='green')
726726> > {: .python}
727727> >
728728> > 
729- > {: .solution}
729+ > {: .solution} -->
730730{: .challenge}
731731
732732
@@ -794,3 +794,18 @@ s_plot.set_xlabel("Plot")
794794<!-- redo plot -->
795795
796796
797+
798+
799+ > ## Take-Home Challenge: More Fun with DataFrames and Plotting
800+ >
801+ > Continue working with the `surveys_df` DataFrame on the following challenges:
802+ >
803+ > 1. Plot the average weight over all species and plots sampled each year (i.e., year on the horizontal axis and average weight on the vertical axis).
804+ >
805+ > 2. Come up with another way to view and/or summarize the observations in this dataset. What do you learn from this?
806+ >
807+ <!-- > > ## Solutions
808+ > >
809+ > > The solutions will be posted in 4-6 days. Feel free to use the `#scripting_help` channel in Slack to discuss these exercises.
810+ > {: .solution} -->
811+ {: .challenge}
0 commit comments