NumPy or Pandas: Keeping array type as integer while having a NaN value

This capability has been added to pandas (beginning with version 0.24):
https://pandas.pydata.org/pandas-docs/version/0.24/whatsnew/v0.24.0.html#optional-integer-na-support

At this point, it requires the use of extension dtype Int64 (capitalized), rather than the default dtype int64 (lowercase).

Leave a Comment