程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Common error reporting solutions for Python

編輯:Python

python Common error reporting solutions

  • One 、 The data contains missing values 、 Infinite problem
    • 1.1 ValueError: Input contains NaN, infinity or a value too large for dtype('float64').
    • 1.2 solve

One 、 The data contains missing values 、 Infinite problem

1.1 ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’).

1.2 solve

  • The data contains missing values 、 Infinite equal . Use the following code to determine and locate which data has the problem
print(np.isinf(X_train).any()) # Judge X_train Is there an infinite number in 
print(np.isfinite(X_train).any()) # Judge X_train Whether or not is a finite number 
print(np.isnan(X_train).any()) # Judge X_train Contains missing values in 


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved