diff --git a/README.md b/README.md index acc9722..05b9eb1 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.1 (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.0 (2024-04-16) Change scraping example to get data from worldfootball.net, since myfootballfacts.com was no longer working. diff --git a/code/03_02_functions.py b/code/03_02_functions.py index 55c771b..39a7774 100644 --- a/code/03_02_functions.py +++ b/code/03_02_functions.py @@ -16,8 +16,8 @@ # book picks up here: -pg.mean() -pg.max() +pg[['shot', 'goal', 'assist', 'pass', 'throw', 'corner']].mean() +pg[['name', 'shot', 'goal', 'assist', 'pass', 'throw', 'corner']].max() # Axis pg[['shot', 'goal', 'assist', 'pass']].mean(axis=0)