Apr-04-2019, 12:30 PM
Hello python community, i need help.
I'm working on machine learning. However, i have problem at the cleaning step.
i use this code:
I continue executing the following lines :
What should i do please ?! i didn't know what to do ?!
I'm working on machine learning. However, i have problem at the cleaning step.
i use this code:
# Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('Rural3.csv') #cleaning missing data from sklearn.preprocessing import Imputer imputer= Imputer(missing_values='NaN', strategy='mean' , axis = 0) imputer.fit(dataset)At this level, a notification appear: Columns (14,15) have mixed types. Specify dtype option on import or set low_memory=False.
I continue executing the following lines :
X = dataset.iloc[:, :-1].values y = dataset.iloc[:, 75].values # Splitting the dataset into the Training set and Test set from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.25, random_state = 0) # Feature Scaling from sklearn.preprocessing import StandardScaler sc = StandardScaler() X_train = sc.fit_transform(X_train) X_test = sc.transform(X_test)At this level, the error appears: ValueError: Input contains infinity or a value too large for dtype('float64').
What should i do please ?! i didn't know what to do ?!