Skip to content

Commit d8f7758

Browse files
committed
added solutions
1 parent 6ded54f commit d8f7758

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

_episodes/04-more-dataframes.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ surveys_df[0:3]
279279
>
280280
> _Remember: R begins indexing lists at 1._
281281
>
282-
<!-- > > ## Solution
282+
> > ## Solution
283283
> >
284284
> > With the same list:
285285
> > `['A','B','C','D','E','F','G','H','I','J']`,
@@ -316,7 +316,7 @@ surveys_df[0:3]
316316
> > This is ignored when you use the syntax
317317
> > `x[0:5]`, and the elements in `1` through
318318
> > `5` are returned.
319-
> {: .solution} -->
319+
> {: .solution}
320320
{: .challenge}
321321
322322
@@ -326,7 +326,7 @@ surveys_df[0:3]
326326
> Combine selecting a subset with column headings and slice syntax for rows. Get
327327
> every 5th row for rows 20-60, from the columns `plot_id`, `species_id`, and `sex`.
328328
>
329-
<!-- > > ## Solution
329+
> > ## Solution
330330
> >
331331
> > ~~~
332332
> > surveys_df[['plot_id', 'species_id','sex']][20:61:5]
@@ -346,7 +346,7 @@ surveys_df[0:3]
346346
> > 60 23 DM M
347347
> > ~~~
348348
> > {: .output}
349-
> {: .solution} -->
349+
> {: .solution}
350350
{: .challenge}
351351
352352
## Changing Values in a DataFrame
@@ -611,7 +611,7 @@ surveys_df.loc[1:4, ['record_id','month']]
611611
>
612612
> 2. Use `.iloc[]` to view the same thing.
613613
>
614-
<!-- > > ## Solution
614+
> > ## Solution
615615
> >
616616
> > ~~~
617617
> > # 1
@@ -621,7 +621,7 @@ surveys_df.loc[1:4, ['record_id','month']]
621621
> > surveys_df.iloc[1:6:2, [5,6]]
622622
> > ~~~
623623
> > {: .python}
624-
> {: .solution} -->
624+
> {: .solution}
625625
{: .challenge}
626626
627627
@@ -675,7 +675,7 @@ surveys_df[(surveys_df.sex == 'M') & (surveys_df.year <= 1985)]
675675
> the year 1999 and that contain weight values less than or equal to 8. How
676676
> many rows did you end up with?
677677
>
678-
<!-- > > ## Solution
678+
> > ## Solution
679679
> >
680680
> > ~~~
681681
> > surveys_df[(surveys_df.weight <= 8.0) & (surveys_df.year == 1999)]
@@ -697,7 +697,7 @@ surveys_df[(surveys_df.sex == 'M') & (surveys_df.year <= 1985)]
697697
> > 29905 4.0
698698
> > ~~~
699699
> > {: .output}
700-
> {: .solution} -->
700+
> {: .solution}
701701
{: .challenge}
702702
703703
## Iterating Over a DataFrame

_episodes/05-seaborn-viz.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ my_fig.set_axis_labels('Weight (g)', 'Hindfoot Length (mm)')
167167
> Remember how to access subsets of a DataFrame based on conditional criteria?
168168
> Plot the scatter plot above for only plot number `12` and color by `sex`. (Make the markers larger circles.)
169169
>
170-
<!-- > > ## Solution
170+
> > ## Solution
171171
> >
172172
> > ~~~
173173
> > my_fig = sns.lmplot(x="weight", y="hindfoot_length",
@@ -180,7 +180,7 @@ my_fig.set_axis_labels('Weight (g)', 'Hindfoot Length (mm)')
180180
> > {: .python}
181181
> >
182182
> > ![png](../fig/05-seaborn-scatter-9.png)
183-
> {: .solution} -->
183+
> {: .solution}
184184
{: .challenge}
185185
186186
@@ -232,7 +232,7 @@ ax.set(ylabel='Species ID', xlabel='Weight (g)')
232232
> measurements for different sexed animals from a single
233233
> species, [*Onychomys leucogaster* (OL)](https://en.wikipedia.org/wiki/Northern_grasshopper_mouse), one of the coolest rodent species:
234234
>
235-
<!-- > > ## Solution
235+
> > ## Solution
236236
> >
237237
> > ~~~
238238
> > fig, ax = plt.subplots(figsize=plot_dims)
@@ -241,7 +241,7 @@ sns.violinplot(x='sex', y='weight', data=surveys_complete[surveys_complete.speci
241241
> > {: .python}
242242
> >
243243
> > ![png](../fig/05-seaborn-violinplot-2.png)
244-
> {: .solution} -->
244+
> {: .solution}
245245
{: .challenge}
246246
247247
# Histograms

0 commit comments

Comments
 (0)