Only integer scalar arrays can be converted to a scalar index how to resolve

左心房为你撑大大i 提交于 2021-01-28 13:41:34

问题


File "C:/Users/Benji/PycharmProjects/Code/ANOTHER22.py", line 57, in generator

x_class[np.array(y)[i]].append(np.array(x)[i])

TypeError: only integer scalar arrays can be converted to a scalar index

x_class = [[] for i in range(len(np.unique(y)))]
    for i in range(len(x)):
        x_class[y[i]].append(x[i])

来源:https://stackoverflow.com/questions/61717955/only-integer-scalar-arrays-can-be-converted-to-a-scalar-index-how-to-resolve

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!