[Numpy-discussion] dtyping with .astype()

josef.pktd@gmai... josef.pktd@gmai...
Mon Oct 17 08:48:23 CDT 2011


On Mon, Oct 17, 2011 at 6:17 AM, Pauli Virtanen <pav@iki.fi> wrote:
> 13.10.2011 12:59, Alex van der Spek kirjoitti:
>> gives me a confusing result. I only asked to name the columns and change their
>> types to half precision floats.
>
> Structured arrays shouldn't be thought as an array with named columns,
> as they are somewhat different.
>
>> What am I missing? How to do this?
>
> np.rec.fromarrays(arr.T, dtype=dt)

y.astype(float16).view(dt)

?
Josef


>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>


More information about the NumPy-Discussion mailing list