简体   繁体   中英

How to convert array str 32 to array int 32 in python

I am trying to convert array str 32 to array int 32 with following code but it raised with error: invalid literal for int() with base 10: '' note that I need a space between values of b as input

import numpy as np
a =np.array( (input('8')))
b =np.array((input('8 '' 6 '' 14 '' 7 '' 3 '' 2 '' 11 '' 10')))
c = b.astype(np.int)
b = np.array(raw_input("input your number:").split())
c = b.astype(np.int)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM