pandas报DataFrame object has no attribute 'as_matrix’解决办法
在网上找一些关于python机器学习的相关代码时,运行时可能会遇到
‘DataFrame’ object has no attribute ‘as_matrix’
这是因为网上的文章可能比较老,使用的是老版本的pandas,而自己的pandas要更加新,所有这个方法就没有了,
解决方法:
将df.as_matrix()改写成 df.values
Removed DataFrame.as_matrix, Series.as_matrix (GH18458)