NaN Values in Series

Learn how NaN values work in series.

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 pd
import numpy as np
nan_series = pd.Series([2, np.nan], index=['Ono', 'Clapton'])
print(nan_series)
...