M
M
mva1782016-06-30 15:51:57
Python
mva178, 2016-06-30 15:51:57

How to transform categorical data with encoded values?

Tell me please.
I have a dataset where one of the variables (family income) has values ​​from 0 to 5, i.e. 0 - income up to 5000 rubles. etc. How can I convert data for input to a neuron or Svm?
Make 6 variables with values ​​0 and 1 okay? there are alternatives?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
doktr, 2016-07-19
@doktr

A function from pandas will do:
pd.get_dummies(df['n_school'])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question