one hot encoding code example
Example 1: one hot encoding python pandas
y = pd.get_dummies(df.Countries, prefix='Country')
print(y.head())
# from here you can merge it onto your main DF
Example 2: one hot encoding numpy
labels = (np.arange(num_labels) == labels[:,None]).astype(np.float32)