[Numpy-discussion] dtyping with .astype()

josef.pktd at gmail.com josef.pktd at gmail.com
Mon Oct 17 09:48:23 EDT 2011


On Mon, Oct 17, 2011 at 6:17 AM, Pauli Virtanen <pav at 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 at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



More information about the NumPy-Discussion mailing list