我有一个numpy浮点数数组,我希望将其转换为一个字符串,以便通过JSON传输:
import numpy as np
#Create an array of float arrays
numbers = np.array([[1.0, 2.0],[3.0,4.0],[5.0,6.0]], dtype=np.float64)
print(numbers)
[[1. 2.]
[3. 4.]
[5. 6.]]
#Convert each row in the array to string and separate by a ','
numbers_to_string_com