数组索引报错IndexError: arrays used as indices must be of integer (or boolean) type

在索引后加上.astype(‘int64’)
如:

self.matrix[p.astype('int64'), t.astype('int64')] += 1 
Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐