[Numpy-discussion] hstack

Malcolm Reynolds malcolm.reynolds@gmail....
Wed Feb 8 10:34:54 CST 2012


On Wed, Feb 8, 2012 at 4:32 PM, Stephanie Cooke
<cooke.stephanie@gmail.com> wrote:
> Hello,
> When I try to use the command hstack, I am given the error message
> "TypeError: hstack() takes exactly 1 argument (2 given)". I have a 9X1
> array (called array) that I would like to concatenate to a 9X2 matrix
> (called matrix), and I try to do this by typing the command
> hstack(array,matrix). I would appreciate any help in getting this to
> work.

You need to put the arrays / matrices you want to stack in a tuple. So
in your case, use "hstack((array,matrix))"  - note the extra

Try "print numpy.hstack.__doc__" for more details.


More information about the NumPy-Discussion mailing list