NaN Values in Series
Learn how NaN values work in series.
We'll cover the following...
The NaN
value
A value that may be familiar to NumPy users, but not Python users in general, is NaN
. When pandas determines that a series holds numeric values but cannot find a number to represent an entry, it will use NaN
. This value stands for “Not A Number” and is usually ignored in arithmetic operations. (Similar to NULL in SQL.)
Here’s a series that has NaN
in it:
Press + to interact
import pandas as pdimport numpy as npnan_series = pd.Series([2, np.nan], index=['Ono', 'Clapton'])print(nan_series)
...