python 类型错误:python TypeError: ufunc ‘subtract‘ did not contain a loop with signature matching types

报错类型

python TypeError: ufunc ‘subtract’ did not contain a loop with signature matching types dtype(‘S32’)

解决方法

原代码:

y = df['target']
X = df.drop('target', axis=1)

修改后的代码:

y = df['target'].values
X = df.drop('target', axis=1).values

猜你喜欢

转载自blog.csdn.net/Algabeno/article/details/129424719