NumPy - Array Data Types
You have a NumPy array of strings representing numbers:
arr = np.array(['1', '2', '3.5']). How do you convert it to a float array?arr = np.array(['1', '2', '3.5']). How do you convert it to a float array?arr.astype(float) converts string numbers to floats correctly.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions