Skip to content

Commit

Permalink
fix: pandas mean defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanbraun committed Apr 22, 2024
1 parent ca6224c commit a888f78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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.9.10 (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.9.8 (2024-02-09)
Fixed answers for exercise 2.1 (thanks for the pull request Nic!).

Expand Down
4 changes: 2 additions & 2 deletions code/03_02_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
# stored
# on Windows it might be something like 'C:/mydir'

DATA_DIR = '/Users/nathan/baseball-book/data'
DATA_DIR = './data'

atbats = pd.read_csv(path.join(DATA_DIR, '2018-season', 'atbats.csv'))

atbats.mean()
atbats[['G', 'AB', 'R', 'H', '2B', '3B', 'HR', 'RBI']].mean()
atbats.max()

# Axis
Expand Down

0 comments on commit a888f78

Please # to comment.