首页 > 解决方案 > 当我运行此代码时,出现错误:“TypeError:参数必须是字符串或数字”

问题描述

这是我的代码:

lbl_enc = preprocessing.LabelEncoder()
y = lbl_enc.fit_transform(data.name_of_the_column.values)

“name_of_the_column”列是 str。我该如何解决?

IN : type(data.name_of_the_column.values[1])
OUT: str

标签: python-3.xnlp

解决方案


推荐阅读