What is the easiest way to convert list with str into list with int in Python? For example, we have to convert [\'1\', \'2\', \'3\']
str
int
[\'1\', \'2\', \'3\']
If It is array and has installed numpy. We can used below code as well.
import numpy as np np.array(['1', '2', '3'],dtype=int)