python - how to generate this type of data? -
i need generate object this:
ndarray: [[1 2 3]] so tried following:
test = [[1, 2, 3]] but not same. tried:
test = [[1 2 3]] but not valid.
how generate it?
in [20]: import numpy np in [21]: test = np.array([[1,2,3]]) in [22]: test out[22]: array([[1, 2, 3]]) in [23]: print(test) [[1 2 3]] in [24]: test.shape out[24]: (1, 3) in [26]: type(test) out[26]: <type 'numpy.ndarray'>
Comments
Post a Comment