[Numpy-discussion] stacking record arrays
Mon Jun 21 13:58:52 CDT 2010
On Mon, Jun 21, 2010 at 1:51 PM, Robert Kern <firstname.lastname@example.org> wrote:
> On Mon, Jun 21, 2010 at 13:44, Benjamin Root <email@example.com> wrote:
> > Hello,
> > I ran into a somewhat counter-intuitive situation that probably should be
> > documented somewhere with respect to record (structured?) arrays. I
> > to stack multiple arrays together that had the same names for the
> > Since I was imagining the columns as having the names (as opposed to
> > I figured vstack() would do the job, but it merely created a sequence of
> > record arrays. Turns out that I had to use hstack() to get what I
> Remember that your structured arrays are simply 1-D vectors of
> records. 1-D vectors are primarily treated as row vectors by things
> that care about "horizontal" and "vertical" for all dtypes, both
> records and "normal" scalars. It just gets a bit confusing because one
> often thinks of 1-D arrays of records as being rows and columns.
Yeah, that's what I ended up realizing after I noticed my output from vstack
wasn't what I expected, which made me try out hstack instead.
> Robert Kern
> "I have come to believe that the whole world is an enigma, a harmless
> enigma that is made terrible by our own mad attempt to interpret it as
> though it had an underlying truth."
> -- Umberto Eco
> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion