[Numpy-discussion] dtyping with .astype()

Pauli Virtanen pav@iki...
Mon Oct 17 09:18:48 CDT 2011


17.10.2011 15:48, josef.pktd@gmail.com kirjoitti:
> On Mon, Oct 17, 2011 at 6:17 AM, Pauli Virtanen <pav@iki.fi> wrote:
[clip]
>>> What am I missing? How to do this?
>>
>> np.rec.fromarrays(arr.T, dtype=dt)
> 
> y.astype(float16).view(dt)

I think this will give surprises if the original array is not in C-order.

	Pauli



More information about the NumPy-Discussion mailing list