import numpy as np x = np.array(['1.1', '2.2', '3.3']) y = x.astype(np.float)
Here is what the above code is Doing:
1. Creating an array of strings
2. Converting the array of strings to an array of floats
The output of the above code is:
array([ 1.1, 2.2, 3.3])