LabelEncoder: TypeError: '>' not supported between instances of 'float' and 'str'

前端 未结 3 1366
一生所求
一生所求 2021-01-30 00:25

I\'m facing this error for multiple variables even treating missing values. For example:

le = preprocessing.LabelEncoder()
categorical = list(df.select_dtypes(in         


        
3条回答
  •  野的像风
    2021-01-30 00:49

    Or use a cast with split to uniform type of str

    unique, counts = numpy.unique(str(a).split(), return_counts=True)
    

提交回复
热议问题