Labelencoder error


#1

Hello All,

I am working on the loan prediction data set and following the instruction on the solution given by Kunal jain
when i run the following code

var_mod = [‘Gender’,‘Married’,‘Dependents’,‘Education’,‘Self_Employed’,‘Property_Area’,‘Loan_Status’]
le = LabelEncoder()
for i in var_mod:
df[i] = le.fit_transform(df[i])

i get this error
’>’ not supported between instances of ‘str’ and ‘float’


#2

Hey @tarvinder.r,

I think this discussion can help you - Getting "TypeError: '>' not supported between instances of 'str' and 'float'"

Regards,
Sanad :slight_smile: