我正在嘗試使用以下代碼將數(shù)組 str 32 轉(zhuǎn)換為數(shù)組 int 32 但引發(fā)錯誤: int() with base 10: '' 的文字無效:請注意,我需要在 b 的值之間有一個空格作為輸入import numpy as npa =np.array( (input('8')))b =np.array((input('8 '' 6 '' 14 '' 7 '' 3 '' 2 '' 11 '' 10')))c = b.astype(np.int)
1 回答

一只甜甜圈
TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超5個贊
b = np.array(raw_input("input your number:").split()) c = b.astype(np.int)
添加回答
舉報
0/150
提交
取消