Why I m Getting ValueError

0 votes

Here is my code:

import pandas as p
import numpy as n
import matplotlib.pyplot as m

dataset = p.read_csv('data.csv')
X = dataset.iloc[:, :-1].values
Y = dataset.iloc[:, 3].values
print(dataset)
from sklearn.impute import SimpleImputer
imputer = SimpleImputer(missing_values= 'NaN', strategy= 'mean' )

imputer = imputer.fit(X[: , 1:3])
X[: , 1:3] = imputerr.transform(X[: , 1:3])

Error:

ValueError: Input contains NaN, infinity or a value too large for dtype('float64')
Nov 28, 2020 in Python by Rohan
• 200 points

edited Nov 30, 2020 by Niroj 631 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

0 votes
1 answer

Why am I getting a error when I am printing two different data types in python?

different data type is being used. that ...READ MORE

answered Mar 6, 2019 in Python by Mohammad
• 3,230 points
1,060 views
0 votes
0 answers

why iam getting this error

Sep 9, 2019 in Python by NEELAPALA
• 120 points

reopened Sep 9, 2019 by Omkar 902 views
0 votes
1 answer

i write this python to read dataset into panda data frame but im getting NameError: name 'true' is not defined. Below is the code:

change  def parse(path):   g = gz ...READ MORE

answered Mar 15, 2020 in Python by Abhishek Shingadiya
3,711 views
0 votes
1 answer

I tried to install this pip cryptography in Pycharm but I'm getting an error

Hello @Dilpreet , Have you tried updating pip version? ...READ MORE

answered Aug 4, 2020 in Python by Niroj
• 82,840 points
3,408 views
0 votes
1 answer

I installed windows 10 through vmware workstation . I want to connect remote machine using python winrm im getting error

Hey, @Natraj, This basically means that no response ...READ MORE

answered Dec 2, 2020 in Python by Gitika
• 65,770 points
990 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,467 views
0 votes
1 answer
0 votes
1 answer

Purpose of fit method in sklearn module in python?

it basically trains your model using the ...READ MORE

answered May 14, 2020 in Python by Mahesh
• 140 points
3,586 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP