votes['class'] = pandas.Categorical(votes['class'].astype('object') , categories=['republican', 'democrat'])