August 2021
Beginner to intermediate
112 pages
1h 29m
English
| Puzzle 11 | Phil? Nah!? |
| | import numpy as np |
| | import pandas as pd |
| | |
| | s = pd.Series([1, 2, np.nan, 4, 5]) |
| | s.fillna(3) |
| | print(s.sum()) |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
This code will print: 12.0
The pandas.Series.fillna documentation says the following:
Returns: Series or None Object with missing values filled or None if inplace=True.
It’s always a good idea to not change ...
Read now
Unlock full access