天天看點

成功解決IndexError: arrays used as indices must be of integer (or boolean) type

解決問題

IndexError: arrays used as indices must be of integer (or boolean) type

解決思路

索引錯誤:用作索引的數組必須是整數(或布爾)類型

解決方法

t    #類型為numpy.ndarray

改為“

t.astype('int64')

哈哈,大功告成!

繼續閱讀