Python: how to convert a string array to a factor list
问题 Python 2.7, numpy, create levels in the form of a list of factors. I have a data file which list independent variables, the last column indicates the class. For example: 2.34,4.23,0.001, ... ,56.44,2.0,"cloudy with a chance of rain" Using numpy, I read all the numeric columns into a matrix, and the last column into an array which I call "classes". In fact, I don't know the class names in advance, so I do not want to use a dictionary. I also do not want to use Pandas. Here is an example of the