当前位置:   article > 正文

Series object has no attribute reshape解决方法_series' object has no attribute 'reshape

series' object has no attribute 'reshape

如图,在进行reshape操作时,由于采用了pandas,pandas的Series没有reshape而报错
在这里插入图片描述
解决方法:
用values方法将Series对象转化成numpy的ndarray,再用ndarray的reshape方法.
StandardScaler().fit_transform(data[‘Amount’].values.reshape(-1, 1))

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小舞很执着/article/detail/901907
推荐阅读
相关标签
  

闽ICP备14008679号