Puzzle 11: fillna()? Phil? Nah!
Let's solve a fillna() puzzle.
We'll cover the following
Guess the output
Try to guess the output of the code below:
import numpy as npimport pandas as pds = pd.Series([1, 2, np.nan, 4, 5])s.fillna(3)print(s.sum())
Quiz
Q
What is the output of the code above?
A)
15.0
B)
nan
C)
12.0
D)
TypeError
Get hands-on with 1300+ tech skills courses.