Answers for "python convert array of float to int"

1

convert all values in array into float

import numpy as np
x = np.array(['1.1', '2.2', '3.3'])
y = x.astype(np.float)
Posted by: Guest on March-06-2020
0

convert 2d string array to float python

import numpy as np

a = ['0.1234', '12345.6789']
a = a.astype(np.float)
print(a)
# Output : [0.1234, 12345.6789]
Posted by: Guest on July-07-2021

Code answers related to "python convert array of float to int"

Python Answers by Framework

Browse Popular Code Answers by Language