pandas is very easy to implement, just convert it into Categories objects. The terms are called factors and levels, and levels are usually automatically converted to numerical storage.
c = ['A','A','A','B','B','C','C','C','C']
category = pd.Categorical(c)
I have never used it in practice. I don’t know if the map function can meet your needs. Please refer to the documentation for details http://pandas.pydata.org/pand...
pandas
is very easy to implement, just convert it into Categories objects. The terms are called factors and levels, and levels are usually automatically converted to numerical storage.Next, check the label of the category
There are ready-made ones in sklearn:
See official documentation for details
You can directly convert between characters and numbers
I have never used it in practice. I don’t know if the
map
function can meet your needs. Please refer to the documentation for detailshttp://pandas.pydata.org/pand...
This is just
映射
logic. There is no need to use pandas and scikit-learn. It’s overkill and overkillIf you have to use pandas, then isn’t this exactly
Series