[Numpy-discussion] dtyping with .astype()

Pauli Virtanen pav at iki.fi
Mon Oct 17 10:18:48 EDT 2011


17.10.2011 15:48, josef.pktd at gmail.com kirjoitti:
> On Mon, Oct 17, 2011 at 6:17 AM, Pauli Virtanen <pav at 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