1
根据以下我有这个TypeError
,我检查了我的df
,它全部只包含数字,当我转换为numpy数组时,是否可能导致这种情况?转换后的阵列有像在异构阵列上调用preprocessing.scale
[Timestamp('1993-02-11 00:00:00') 28.1216 28.3374 ...]
任何建议如何解决这个,请?
df:
Date Open High Low Close Volume
9 1993-02-11 28.1216 28.3374 28.1216 28.2197 19500
10 1993-02-12 28.1804 28.1804 28.0038 28.0038 42500
11 1993-02-16 27.9253 27.9253 27.2581 27.2974 374800
12 1993-02-17 27.2974 27.3366 27.1796 27.2777 210900
X = np.array(df.drop(['High'], 1))
X = preprocessing.scale(X)
TypeError: float() argument must be a string or a number
好开始,错误是不言自明的:它不能处理的datetime对象或任何你的日期。 – sascha