From 66968ad6deabed30701260247c02255d8bf8a61c Mon Sep 17 00:00:00 2001 From: Nathan Braun Date: Mon, 22 Apr 2024 11:56:25 -0500 Subject: [PATCH] fix: pandas mean issue --- README.md | 5 +++++ code/03_02_functions.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ce4121b..df93d88 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,11 @@ If I were using Windows, it might look like this: Set these aside for now and we'll pick them up in chapter 2. ## Changelog +### v0.1.4 (2024-04-22) +Fix Pandas `mean` example. More: Pandas changed their defaults to throw an +error if you try to call this on string columns. Fixed example to explicitely +only call it on numeric data. + ### v0.1.3 (2024-02-19) Fixed typo in the introduction — thanks Matt! diff --git a/code/03_02_functions.py b/code/03_02_functions.py index 93a0d08..cc371c7 100644 --- a/code/03_02_functions.py +++ b/code/03_02_functions.py @@ -15,7 +15,7 @@ # book picks up here: -pg.mean() +pg[['shots', 'goals', 'assists', 'time_ice', 'pen_min']].mean() pg.max() # Axis