I am getting
TypeError: unhashable type: \'slice\'
when executing the below code for encoding categorical data in Python. Can a
if you use .Values while creating the matrix X and Y vectors it will fix the problem.
y=dataset.iloc[:, 4].values
X=dataset.iloc[:, 0:4].values
when you use .Values it creates a Object representation of the created matrix will be returned with the axes removed. Check the below link for more information
https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.values.html