The below piece of code works fine.Here,data is a datafram and location,rest_type and cuisines are columns in it.
from sklearn.preprocessing import LabelEncod