Skip to content

Commit 7634022

Browse files
authored
Merge pull request #565 from catchSheep/main
Fix default values of .mean for pandas version >= 2
2 parents e2b2a05 + 662e357 commit 7634022

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

episodes/02-starting-with-data.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,10 +516,10 @@ numeric data.
516516
# Summary statistics for all numeric columns by sex
517517
grouped_data.describe()
518518
# Provide the mean for each numeric column by sex
519-
grouped_data.mean()
519+
grouped_data.mean(numeric_only=True)
520520
```
521521

522-
`grouped_data.mean()` **OUTPUT:**
522+
`grouped_data.mean(numeric_only=True)` **OUTPUT:**
523523

524524
```output
525525
record_id month day year plot_id \
@@ -546,7 +546,7 @@ summary stats.
546546
then calculate mean values?
547547

548548
- `grouped_data2 = surveys_df.groupby(['plot_id', 'sex'])`
549-
- `grouped_data2.mean()`
549+
- `grouped_data2.mean(numeric_only=True)`
550550

551551
3. Summarize weight values for each site in your data. HINT: you can use the
552552
following syntax to only create summary statistics for one column in your data.

0 commit comments

Comments
 (0)