9951 explained code solutions for 126 technologies


python-numpyConvert Numpy array to string


import numpy as np

a = np.array([1, 2, 3, 4])
str = np.array2string(a)ctrl + c
import numpy as np

load Numpy module for Python

np.array

declare Numpy array

[1, 2, 3, 4]

sample array

.array2string(

converts given Numpy array to string

str

will contain resulting string