文章目录 问题复现 报错 解决方案 问题复现 import numpy as np a = np.arange(10) a[1] = np.nan 报错 ValueError: cannot convert float NaN to integer 解决方案 a.astype