pandas.errors.IntCastingNaNError — pandas 2.3.3 documentation (original) (raw)

exception pandas.errors.IntCastingNaNError[source]#

Exception raised when converting (astype) an array with NaN to an integer type.

Examples

pd.DataFrame(np.array([[1, np.nan], [2, 3]]), dtype="i8") Traceback (most recent call last): IntCastingNaNError: Cannot convert non-finite values (NA or inf) to integer