简体   繁体   English

Python输入包含无穷大或值对于dtype('float64')

[英]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.

相关问题 输入包含对于 dtype“float64”来说太大的无穷大值 - Input contains infinity of value too large for dtype “float64” 文本分类+朴素贝叶斯+ Python:输入包含NaN,无穷大或dtype(&#39;float64&#39;)太大的值 - Text classification + Naive Bayes + Python : Input contains NaN, infinity or a value too large for dtype('float64') Python - 输入包含NaN,无穷大或对于dtype(&#39;float64&#39;)来说太大的值 - Python - Input contains NaN, infinity or a value too large for dtype('float64') Python 错误帮助:“ValueError:输入包含 NaN、无穷大或对于 dtype('float64') 而言太大的值。” - Python error help: “ValueError: Input contains NaN, infinity or a value too large for dtype('float64').” Python 3:错误:ValueError:输入包含 NaN、无穷大或对于 dtype('float64')来说太大的值 - Python 3: Error: ValueError: Input contains NaN, infinity or a value too large for dtype('float64') KNN ValueError:输入包含NaN,无穷大或对于dtype(&#39;float64&#39;)而言太大的值 - KNN ValueError: Input contains NaN, infinity or a value too large for dtype('float64') 如何解决ValueError:输入包含NaN,无穷大或对于dtype来说太大的值(&#39;float64&#39;) - How to resolve ValueError: Input contains NaN, infinity or a value too large for dtype('float64') 输入包含NaN,无穷大或因dtype(&#39;float64&#39;)错误而过大的值,但数据集中无值 - Input contains NaN, infinity or a value too large for dtype('float64') error but no values in dataset 如何修复 ValueError:输入包含 NaN、无穷大或对于 dtype(&#39;float64&#39;) 来说太大的值。 错误 - How to fix ValueError: Input contains NaN, infinity or a value too large for dtype('float64'). Error sklearn错误ValueError:输入包含NaN,无穷大或对于dtype(&#39;float64&#39;)来说太大的值 - sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype('float64')
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM