typeerror 3a unhashable type 3a 27slice 27

Solutions on MaxInterview for typeerror 3a unhashable type 3a 27slice 27 by the best coders in the world

showing results for - "typeerror 3a unhashable type 3a 27slice 27"
Luisa
04 Oct 2019
1# Importing the libraries
2import numpy as np
3import matplotlib.pyplot as plt
4import pandas as pd
5
6# Importing the dataset
7# dataset = pd.read_csv('50_Startups.csv')
8
9dataset = pd.DataFrame(np.random.rand(10, 10))
10y=dataset.iloc[:, 4]
11X=dataset.iloc[:, 0:4]
12
13# Encoding categorical data
14from sklearn.preprocessing import LabelEncoder, OneHotEncoder
15labelencoder_X = LabelEncoder()
16
17#  I changed this line
18X.values[:, 3] = labelencoder_X.fit_transform(X.values[:, 3])
19