python 报错 AttributeError: 'Series' object has no attribute 'as_matrix'

代码:

px = X_pca[:, 0][y_train.as_matrix() == i]  # python3.X报错

原因:

python3.X中as_matrix()不可用

修改:

px = X_pca[:, 0][y_train.values == i]

  

 

posted @ 2020-09-08 16:27  君君姐  阅读(1368)  评论(0编辑  收藏  举报