I have two ndarrays with "compatible" but non-identical dtypes, like this:
In [22]: A = numpy.empty(shape=(5), dtype=[("A", "f4"), ("B", "f4")])
In [23]: B = numpy.empty(shape=(5), dtype=[("B", "f4"), ("A", "f4")])
In [24]: numpy.concatenate((A, B))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-24-c930307fb7e4> in <module>()
----> 1 numpy.concatenate((A, B))
TypeError: invalid type promotion
Short of concatenating explicitly field by field, is there a way to concatenate the two?
How did I get to this situation? I'm not sure, possibly a bug earlier in my code, but regardless of me fixing the earlier bug, I'm curious of the answer.