Skip to content

Commit

Permalink
Update pandas.md
Browse files Browse the repository at this point in the history
Fix: Handled missing values in numeric columns by using numeric_only=True in mean() to avoid errors from non-numeric columns.
  • Loading branch information
PaperPlaneDeemo authored Oct 10, 2024
1 parent e6b18cc commit 4e34c28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapter_preliminaries/pandas.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ print(data)
```{.python .input}
#@tab all
inputs, outputs = data.iloc[:, 0:2], data.iloc[:, 2]
inputs = inputs.fillna(inputs.mean())
inputs = inputs.fillna(inputs.mean(numeric_only=1))
print(inputs)
```

Expand Down

0 comments on commit 4e34c28

Please sign in to comment.