Answers for "np array str to float"

0

string array to float array python

import numpy as np
x = np.array(['1.1', '2.2', '3.3'])
y = x.astype(np.float)
print(y) # Output : [1.1, 2.2, 3.3]
Posted by: Guest on July-16-2021
1

np float to int

int_array = float_array.astype(int)
Posted by: Guest on December-23-2020

Python Answers by Framework

Browse Popular Code Answers by Language