I want to be able to calculate the mean, min and max of A
:
import numpy as np
A = ['33.33', '33.33', '33.33', '33.37']
NA = np.asarray(A)
AVG = np.mean(NA, axis=0)
print AVG
This does not work, unless converted to:
A = [33.33, 33.33, 33.33, 33.37]
Is it possible to perform this conversion automatically?
you want astype
NA = NA.astype(float)