I am a newbie in python programming for data science. I was trying to convert numerical column values into bins with the code below:
bins = [12, 24, 48, 60, np.inf]
names = ['Tenure_12', 'Tenure_24', 'Tenure_48', 'Tenure_60']
telco['tenure_bin'] = pd.cut(telco['tenure'], bins, labels=names)
I am getting this error: TypeError: '<' not supported between instances of 'float' and 'str'. 'telco' is the name of the dataset and 'tenure' is the column name whose values I am trying to convert into bins
Can I please get some help on how to do away with this error?