append a numpy array to a numpy array

Posted by Fraz on Stack Overflow See other posts from Stack Overflow or by Fraz
Published on 2012-03-19T17:55:24Z Indexed on 2012/03/19 18:03 UTC
Read the original article Hit count: 572

Filed under:
|

I just started programming in python and am very new to numpy packages.. so still trying to get a hang of it. I have a an numpy_array so something like [ a b c]

And then I want to append it into anotehr numpyarray (Just like we create a list of lists) How do we create an array of numpy arrays containing numpy arrays I tried to do the following without any luck

>>> M = np.array([])
>>> M
array([], dtype=float64)
>>> M.append(a,axis=0)
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
AttributeError: 'numpy.ndarray' object has no attribute 'append'
>>> a
array([1, 2, 3])

© Stack Overflow or respective owner

Related posts about python

Related posts about numpy