Python “TypeError: unhashable type: 'slice'” for encoding categorical data

后端 未结 7 895
长情又很酷
长情又很酷 2020-12-04 16:03

I am getting

TypeError: unhashable type: \'slice\'

when executing the below code for encoding categorical data in Python. Can a

7条回答
  •  醉梦人生
    2020-12-04 16:44

    While creating the matrix X and Y vector use values.

    X=dataset.iloc[:,4].values
    Y=dataset.iloc[:,0:4].values
    

    It will definitely solve your problem.

提交回复
热议问题