I have the following Categorical Data:
['Self employed', 'Government Dependent',
'Formally employed Private', 'Informally employed',
'Formally employed Government', 'Farming and Fishing',
'Remittance Dependent', 'Other Income',
'Don't Know/Refuse to answer', 'No Income']
How do I put them in bins such that:
['Government Dependent','Formally employed Government','Formally
employed Private'] = 0
['Remittance Dependent', 'Informally employed','Self employed','Other Income'] = 1
['Dont Know/Refuse to answer', 'No Income','Farming and Fishing'] = 2
I already know of putting numerical data into categorical bins....can the reverse be done?
TRAIN = pd.read_csv("Train_v2.csv")
TRAIN['job_type'].unique()
output:
array(['Self employed', 'Government Dependent',
'Formally employed Private', 'Informally employed',
'Formally employed Government', 'Farming and Fishing',
'Remittance Dependent', 'Other Income',
'Dont Know/Refuse to answer', 'No Income'], dtype=object)