[Numpy-discussion] re cfunctions help with concatenating (vstack, hstack, etc.)
Mon Dec 7 19:39:46 CST 2009
On Mon, Dec 7, 2009 at 7:47 PM, Pierre GM <email@example.com> wrote:
> 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...
FWIW, I find the docs to be pretty good (maybe some of the examples
could be easier to read?), at least for the functions I make a lot of
use of, which is most of them now that I look again. I haven't had to
read the source once, which is nice ;)
More information about the NumPy-Discussion