[SciPy-user] Concatenating 1D arrays

Rudolph van der Merwe rudolphv at gmail.com
Thu Feb 9 04:43:22 CST 2006

On 2/8/06, Robert Kern <robert.kern at gmail.com> wrote:
> x = []
> y = []
> while have_more_vectors():
>     x.append(get_column_vector_from_somewhere())
>     y.append(get_row_vector_from_somewhere())
> x = hstack(x)
> y = vstack(y)

The problem (as far as I know) is that all vectors (1-D arrays) are
treated as row vectors in Numpy. So the example for y will work, but
I'm not sure it will work for x. How do you construct a 1-D column
vector which can then be appended to a list and finally hstacked?


Rudolph van der Merwe

More information about the SciPy-user mailing list