I have a dataframe which includes both numeric and non numeric values (It includes some special characters like -, space etc). I want to encode that Non Numeric value to run corr(). Non numeric Column name eg: 'Department', 'Location', etc. I used Label Encoder(). But it shows a TypeError;
TypeError: '<' not supported between instances of 'int' and 'str'
I used this code :
le = preprocessing.LabelEncoder()
X_train['Department'] = le.fit_transform(X_train['Department'])