Is there a function to convert a string into a number and back for machine learning
You should consider a one-hot encoding, which can be done easily with pandas via the get_dummies function. This will create binary columns for each "category" (i.e. unique string).
I have a lot of strings in a pandas dataframe, I want to assign every string a number for keras.
the string represent a location:
CwmyNiVcURtyAf+o/6wbAg==
I want to turn it into a number and back again. I'm using keras, tensorflow and pandas. Does one of the modules contain a function which does that? Or do I have to write a hashtable?
Like this:
CwmyNiVcURtyAf+o/6wbAg== => 1
CwmyUSVcbBtiBQEkAN4bVbA= =>  2
CwmypSVdCRNYBv4MAFUTSRY= =>  3
CwnBoiVCjRNPBAAJ/ysTHw== =>  4
CwnBoiVCjRNfBv5QAEITCA== =>  5
CwmyUSVcbBtiBQEkAN4bVbA= =>  2
I have ~8000 locations and each location is 15 times in the Dataframe