看板 Python 關於我們 聯絡資訊
大家好,我想把train_X裡的資料全部統一成float,但試了很久依舊跑出ValueError: could not convert string to float: 'X',不太懂問題出在哪。 http://i.imgur.com/ndjNC8M.png 用了astype也一樣 http://i.imgur.com/Dxx1KsU.png 對了,train_X是ndarray http://i.imgur.com/4sb4zCd.png -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 110.50.175.10 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1592123899.A.CDC.html
TuCH: 阿就資料有個欄位是'X' 沒辦法轉float 檢查一下資料吧 06/14 16:57
好 感謝 ※ 編輯: Ryan45758 (110.50.175.10 臺灣), 06/14/2020 17:06:22
Pieteacher: mixed type 06/14 18:19
stlevi811101: python報錯已經很友善了 可能要試著學看ValueError 06/14 23:57
mychiux413: 同意樓上,python報錯算很清楚了,仔細看都能解掉 06/15 14:18
salmon12706: 工研院人工智慧課程推薦https://reurl.cc/4RDRaK 06/29 16:14