Sorting through list and storing different variables : So I'm using pandas to read from a row of data that looks like this:

     0   overcast
     1   overcast
     2   overcast
     3   overcast
     4      rainy
     5      rainy
     6      rainy
     7      rainy
     8      rainy
     9      sunny
     10     sunny
     11     sunny
     12     sunny
     13     sunny

And I wish to store overcast (first entry) as a variable, and then iterate through the list until there is a contrasting variable, and store that one also. This should assign any other contrasting variables along the way until until the end of the list. 

So in this case, I should end up with 3 variables. 0 = overcast, 1 = rainy, 2 = sunny but I want this to work just as well if there are five different conditions in a classifier, not just two or three.

I'm having a hard time figuring out the best way to do this or maybe there is something in pandas that does this for me that I'm missing? 