In Working with missing data, we saw that pandas primarily uses NaN to represent
missing data. Because NaN is a float, this forces an array of integers with
any missing values to become floating point. In some cases, this may not matter
much. But if your integer column is, say, an identifier, casting to float can
be problematic. Some integers cannot even be represented as floating point
numbers.
Construction
pandas can represent integer data with possibly missing values using
arrays.IntegerArray. This is an extension type
implemented within pandas.
This array can be stored in a DataFrame or Series like any
NumPy array.
In [5]: pd.Series(arr)Out[5]: 0 11 22 <NA>dtype: Int64
You can also pass the list-like object to the Series constructor
with the dtype.
Operations
Operations involving an integer array will behave similar to NumPy arrays.
Missing values will be propagated, and the data will be coerced to another
dtype if needed.