Answers for "how to convert float type to int in python an array"

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

how to make all elements in array int python

for i, v in enumerate(numbers): numbers[i] = int(v)
Posted by: Guest on October-23-2020

Code answers related to "how to convert float type to int in python an array"

Python Answers by Framework

Browse Popular Code Answers by Language