[英]Python Input contains infinity or a value too large for dtype('float64')
I am stuck with a problem. 我陷入了一个问题。 I am trying to open a csv and put in in a neural network, but it gives me this error:
我试图打开一个csv并放入一个神经网络,但这给了我这个错误:
File "/var/www/test.nl/ai_crypto.py", line 126, in <module>
validation_x, validation_y = preprocess_df(validation_main_df)
File "/var/www/test.nl/ai_crypto.py", line 38, in preprocess_df
df[col] = preprocessing.scale(df[col].values)
File "/usr/local/lib/python2.7/dist-packages/sklearn/preprocessing/data.py", line 145, in scale
dtype=FLOAT_DTYPES, force_all_finite='allow-nan')
File "/usr/local/lib/python2.7/dist-packages/sklearn/utils/validation.py", line 568, in check_array
allow_nan=force_all_finite == 'allow-nan')
File "/usr/local/lib/python2.7/dist-packages/sklearn/utils/validation.py", line 56, in _assert_all_finite
raise ValueError(msg_err.format(type_err, X.dtype))
ValueError: Input contains infinity or a value too large for dtype('float64')
Here is my script with the 3 csv files I use: 这是我使用的3个csv文件的脚本:
https://vreesie02.stackstorage.com/s/JwJxwOkmAAjahlH https://vreesie02.stackstorage.com/s/2TNGbWkQMpIXYl2 https://vreesie02.stackstorage.com/s/NMgYYrlotN48eTn https://vreesie02.stackstorage.com/s/IWVVuiUc38s9yVv
https://vreesie02.stackstorage.com/s/JwJxwOkmAAjahlH https://vreesie02.stackstorage.com/s/2TNGbWkQMpIXYl2 https://vreesie02.stackstorage.com/s/NMgYYrlotN48eTn https://vreesie02.stackstorage.com/s / IWVVuiUc38s9yVv
This is not a duplicate of: 这不是以下内容的重复:
sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype('float64')
sklearn错误ValueError:输入包含NaN,无穷大或对于dtype('float64')而言太大的值
Because I have checked the awnsers and I already used the accepted awnser, but that doesn't fix my problem 因为我已经检查过遮阳篷,并且已经使用了可接受的遮阳篷,但这并不能解决我的问题
Can someone please help me with this one, I am stuck with this error for almost 2 weeks and I can't figure it out!? 有人可以帮我解决这个问题,我在这个错误中停留了将近2个星期,我无法解决!
我已经通过删除值为0的行来修复它。CSV文件很少为0,因此python脚本无法使用这些数字。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.