pandas.errors.IntCastingNaNError #

异常 pandas.errors。IntCastingNaNError [来源] #

astype将NaN 数组转换 () 为整数类型时引发异常。

例子

>>> 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