I use an external module ( libsvm ) that does not support numpy arrays, only tuples, lists, and dicts. But my data is in a 2d numpy array. How can I convert it to the Python path, aka without loops.
>>> import numpy >>> array = numpy.ones((2,4)) >>> data_list = list(array) >>> data_list [array([ 1., 1., 1., 1.]), array([ 1., 1., 1., 1.])] >>> type(data_list[0]) <type 'numpy.ndarray'>
python arrays list numpy multidimensional-array
Framester Mar 15 2018-12-15T00: 00Z
source share