Skip to content

Instantly share code, notes, and snippets.

@findtharun
Created June 7, 2020 07:29
Show Gist options
  • Save findtharun/1b6e59adc9c33e8575b5e30291eec782 to your computer and use it in GitHub Desktop.
Save findtharun/1b6e59adc9c33e8575b5e30291eec782 to your computer and use it in GitHub Desktop.
from sklearn.preprocessing import LabelEncoder
le=LabelEncoder()
dataset['variety']=le.fit_transform(dataset['variety'])
dataset = pd.concat([dataset['variety'], dataset.drop(['variety'], axis=1)], axis=1)
dataset.head(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment