esheldon/esutil

add function to numpy_util to combine fields from two arrays

Closed this issue · 0 comments

Make an array from the combined set of fields

a1 = np.zeros(n, dtype=[('ra', 'f8'), ('dec', 'f8')])
a2 = np.zeros(n, dtype=[('id', 'i8'), ('name', 'U10')])

# this makes a new array with the combined set of fields
a = eu.numpy_util.combine_fields(a1, a2)

other possible names

a = eu.numpy_util.combine_arrays(a1, a2)
a = eu.numpy_util.combine_array_fields(a1, a2)