AttributeError: ‘DataFrame‘ object has no attribute ‘flatten‘解决办法

AttributeError: ‘DataFrame‘ object has no attribute ‘flatten‘解决办法_第1张图片

pycharm中遇到问题: AttributeError: 'DataFrame' object has no attribute 'flatten'

原来代码:

y_test_predict =y_test_predict.flatten()

解决办法:

原因是需要将类型转化为array

y_test_predict =np.array(y_test_predict).flatten()

你可能感兴趣的:(python,pycharm,开发语言)