TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely錯誤解決方法
將一個list矩陣轉化為numpy陣列之後,使用np.isnan()方法,報出了這麼一個錯誤:
TypeError: ufunc ‘isnan’ not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ‘‘safe’’
經過測試,發現是二維list轉化為numpy陣列的時候就存在問題了。
出錯原因是list第二維的元素個數不一致導致如:
list1 = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9, 10]]
這時候使用 np.array(list1),輸出如下內容:
[
list(1, 2, 3),
list(4, 5, 6),
list(7, 8, 9, 10)
]
接著使用np.isnan()方法,就會報出最上面的錯誤。
因為第三行是4個元素,所以無法轉化為我們想要的numpy陣列,解決方法就是將列數改為一致即可。
相關推薦
TypeError: ufunc 39;isnan39; not supported for the input types, and the inputs could not be safely錯誤解決方法
將一個list矩陣轉化為numpy陣列之後,使用np.isnan()方法,報出了這麼一個錯誤: TypeError: ufunc ‘isnan’ not supported for the input types, and the inputs could not be sa
企業運維案例:xxx is not in the sudoers file.This incident will be reported” 錯誤解決方法
時報 nop nbsp 因此 文件 swd bsp user incident CentOS6系統下,普通用戶使用sudo執行命令時報錯: xxx is not in the sudoers file.This incident will be reported" 解決
Content type 39;application/x-www-form-urlencoded;charset=UTF-839; not supported for @RequestBody XXX
orm app support ram supported json 重新 使用 rip 問題描述 前端使用ajax發送post請求發送Json數據,spring mvc報Content type ‘application/x-www-form-urlencoded;ch
appium解決無法通過name屬性識別元素org.openqa.selenium.InvalidSelectorException: Locator Strategy 39;name39; is not supported for this session
執行程式碼、: public AndroidDriver<AndroidElement> appiumDriver; appiumDriver.findElement(By.name("我的")).click(); 報錯如下: 去到appium安裝目錄下,找到appiu
Appium 運行腳本報錯InvalidSelectorException: Message: Locator Strategy 39;css selector39; is not supported for (轉)
解決 cbc support 題解 cat 轉載 LIDS nbsp 重新 現象:Appium運行腳本報錯InvalidSelectorException: Message: Locator Strategy ‘css selector‘ is not supported
Ubuntu下連接mysql出現 ERROR 1698 (28000): Access denied for user 39;root39;@39;localhost39;錯誤解決方法
use ces 數據 表示 vim amp https 創建 sel ubuntu版本:18.04 mysql版本:5.7.24 ubuntu安裝mysql後用root賬戶登入會出現問題:ERROR 1698 (28000): Access denied
ABIs [armeabi] are not supported for platform 的解決
解決方法,在app的build.gradle的ndk標籤下,將armeabi 刪除掉。 修改前: ndk { abiFilters 'armeabi' , 'armeabi-v7a' } 修改後: ndk { abiFilters 'armeabi-v7a' }
VC6.0報錯:"Error spawning 39;vcspawn.exe39;. The build could not be performed"解決方法 (2011-05-05 10:14:50)
很長時間沒有使用VC6.0.今天有個程式需要在VC6.0下編譯,結果出現了這個報錯,在網上找了一通,按照他們的方法搞了一通也沒有解決,我畢竟身經百戰,自己思考了一下,還是解決了.做下面的一些工作,基本上可以解決: 1.設定系統環境變數:ComSpec=C:\Windows\System3
mysql中“1271 - Illegal mix of collations for operation 39;like39;”錯誤解決方法
time,date,datetime,timestamp 型別的欄位在 select 查詢時使用 like '%中文%' 會出現“1271 - Illegal mix of collations for operation 'like'”錯誤。 在MySQL 5.5以上的版本中,將模糊查詢語句改
Storm-Kafka: Offset lags for kafka not supported for older versions
最近又要遷移HADOOP,遷移過程不做表述,因為我使用了Storm實時流元件,之前版本是1.0.2,目前最新版1.2.2. 老版本storm和kafka結合的包是storm-kafka, 新版本的包為storm kafka client。我用老的JAR部署到STORM顯示了一個告警: Offs
There is no setter for property named 39;dd_valueId39; in 39;class com.manager.pojo.DataDictionary39;的錯誤解決方法
錯誤提示我在 class com.manager.pojo.DataDictionary這個實體類裡沒有屬性’dd_valueId’的setter方法 DataDictionary程式碼 我拉下去看了,所有的欄位都是有get和set方法的 MyBatis對映檔案程
學習Spring JPA時報的Not supported for DML operations 錯誤
在執行JPA修改資料程式碼報 Not supported for DML operations 錯誤 @Query(value = "update User user set user
ORA-32773: operation not supported for smallfile tablespace
想把TABLESPACE從autoextend on改成autoextend off, 使用以下語句就會報錯: alter tablespace TEST_DATA autoextend off; 要從DATAFILE 那裡改: alter database datafi
升級PHP7後PHP程式提示錯誤:operator not supported for strings in原因及解決方法
PHP Fatal error: [] operator not supported for strings in …… 查詢資料後發現是因為以下原因造成的 在對某一個變數進行第二次賦值的時候,也就是在同一頁面內對同一變數第二次賦值,但值的型別前後不一致會導致這
解決ReactNative報錯Listener is not supported for native driven events
報錯:Listener is not supported for native driven events 根據圖中的路徑,找到那個.js檔案開啟。 搜尋Listener is not supported for native driven events 刪掉上
idea多Module出現依賴迴圈問題----aAnnotation processing is not supported for module cycles
idea迴圈依賴aAnnotation processing is not supported for module cycles.1. 錯誤現象 Error:java: Annotation processing is not supported for module
android sudio升級後報錯ABIs [armeabi] are not supported for platform. Supported ABIs are [arm64-v8a, arme
Although you should build a single APK to support all your target devices whenever possible, that might result in a very large APK due to files needed to s
JVisualVM之GC外掛+錯誤"not supported for this jvm"+命令jstatd
開發十年,就只剩下這套架構體系了! >>>
gatling壓力測試工具啟動gatling.bat命令行窗口報Error occurred during initialization of VM Could not reserve enough space for 1048576KB object heap錯誤解決方法
大於 spa ava color default class -xms 查看系統 測試 原因是:Java虛擬機(JVM)分配的內存大於系統可用內存數,所以沒有足夠的空間分配給JVM來創建Object 解決方法:編輯gatling.bat文件,查看系統剩余內存大小,修改分配的
cannot import name 39;cmdoptions39; 錯誤解決方法
在升級pip的時候,造成了pip損壞且發生錯誤。執行pip --version 命令仍然報出此錯誤 解決方法如下: 1. 首先執行命令: python -m ensurepip --default-pip 2.下載get-pip.py檔案,地址 http