AttributeError: ‘Series’ object has no attribute ‘reshape’
Series数据类型没有reshape函数
解决办法:
用values方法将Series对象转化成numpy的ndarray,再用ndarray的reshape方法.
data[‘Amount’].values.reshape(-1, 1)
另外:pandas有两种对象:Series 和DataFrame。
可以这么理解,DataFrame像一张表,Series是指表里的某一行数据或某一列数据