[Numpy-discussion] how can we concatenate structured arrays ?
Wed Sep 16 04:10:43 CDT 2009
On Wed, Sep 16, 2009 at 4:42 AM, Pierre GM <email@example.com> wrote:
> On Sep 16, 2009, at 4:25 AM, firstname.lastname@example.org wrote:
>> I have two structured arrays of different types. How can I
>> horizontally concatenate the two arrays? Is there a direct way, or do
>> I need to start from scratch?
> Check numpy.lib.recfunctions, that should get you started.
Thanks, I was doing that, but without reading through every option
of every function, they all seem to do something more
complicated, like merge or joinby,
append_fields doesn't look very convenient, adds one by one
looking some more recursive_fill_fields seems also to do the
loop (but also handles nested structured arrays)
tt = np.empty((10,1),dt2)
So, I guess the answer is, loop over columns of structured arrays
> NumPy-Discussion mailing list
More information about the NumPy-Discussion