On 11 May 2017, at 8:52 pm, Isaac Gerg <isaac.g...@gergltd.com> wrote:
> 
> Looking at the code, i think merge and stack take in ndarrays, not recarrays
> is that correct?

It should accept either; however if your a and b are two recarrays with all 
uniquely named columns
to get the 10-column recarray in your original example you should do

newtable = np.lib.recfunctions.merge_arrays([a, b], flatten=True, 
asrecarray=True)

otherwise newtable will be a recarray of two columns with 5 nested subcolumns 
each
(i.e. each column will have a dtype [(‘col0’, ‘<f8’), (‘col1’, … (‘col4, 
‘<f8’)])

Duplicate column names will raise an error with ‘flatten=True’.


                                Derek

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to