On Apr 9, 2:19 am, elwood <epolo...@[EMAIL PROTECTED]
> wrote:
> Alas, this is a form of concatenation, but it does not produce
> the required results.
> I need to concatenate by COLUMN, not row.
> If I code the concatenation you show, it produces:
> column 1:
> 1 2
> 3 4
> 5 6
>
> Whereas I need it to paste the columns together such that I
> get
> 1 3 5
> 2 4 6
>
> To be specific, each iteration of the loop
> I calculate new values of x and y
> I want to do the following, but using concatenation
> outputarry[0,0]=x1
> outputarry[1,0]=y1
>
> next iteration
> outputarry[0,1]=x2
> outputarry[1,1]=y2
>
> to get a final array where x values are in column 0
> y values are in column 1
You're almost where you want to be :-)
You can use TRANSPOSE your array to get the desired effect. It does
make concatenating a little bit more tricky, but with the help of
these two tutorials:
http://www.dfanning.com/tips/array_concatenation.html
http://www.dfanning.com/tips/rebin_magic.html
you'll be flying through it before you know it!
Alternatively you can let your concatenation happen row-by-row until
you're done, and then just transpose at the end, if that's simpler.
Good luck,
Chris


|