[Numpy-discussion] re cfunctions help with concatenating (vstack, hstack, etc.)
Mon Dec 7 18:47:16 CST 2009
On Dec 7, 2009, at 7:12 PM, Skipper Seabold wrote:
> On Mon, Dec 7, 2009 at 7:00 PM, John [H2O] <firstname.lastname@example.org> wrote:
>> Hello (Pierre?),
>> I'm trying to work more with structured arrays, which at times seems great,
>> and at others (due to my lack of familiarity) very frustrating.
Like Robert said, you still have a structured array (named fields), but not a recarray (where fields can be accessed as attributes). Use a simple .view(np.recarray) or .view(np.ma.MaskedRecords) to get the field-as-attributes behavior, if you really need it.
> You can try passing usemask=False and asrecarray=True to stack_arrays.
> I had to play with these when using the recfunctions at times. I'm
> not sure the defaults are consistent, though I didn't really check.
> Incidentally, is there a reason that the recfunctions aren't imported
> into the np.lib namespace?
Because I'm still unsure whether they're completely baked. You mentioned that the defaults may not be consistent, that's one of the aspects we need to investigate further, along with testing, proper docs...
More information about the NumPy-Discussion