点击运行
import numpy as np a = np.array([np.nan, 1,2,np.nan,3,4,5]) print (a[~np.isnan(a)])
运行结果 :
正在执行...