Python 类型错误:'<';在';str';和';int';是fit_变换的错误

Python 类型错误:'<';在';str';和';int';是fit_变换的错误,python,typeerror,Python,Typeerror,数据中没有空值或na值。这里怎么了?我无法理解。简单地说,有些记录是字符串,有些是整数。当您尝试应用转换时,算法需要能够对值进行排序,但无法确定如何对字符串(如“foo”(或“5”)和数字(如6)进行排序。 from mlxtend.preprocessing import TransactionEncoder te = TransactionEncoder() te_arry = te.fit_transform(record) this is the code and record val

数据中没有空值或na值。这里怎么了?我无法理解。

简单地说,有些记录是字符串,有些是整数。当您尝试应用转换时,算法需要能够对值进行排序,但无法确定如何对字符串(如
“foo”
(或
“5”
)和数字(如
6
)进行排序。
from mlxtend.preprocessing import TransactionEncoder

te = TransactionEncoder()
te_arry = te.fit_transform(record)
this is the code and record value is 

record = []

for i in range(df1.shape[0]):
    record.append(list(df1.values[i]))
record