[Numpy-discussion] How to change the dtype of a structured or record array

Bruce Southey bsouthey@gmail....
Tue Sep 15 08:03:55 CDT 2009

On 09/15/2009 07:46 AM, Stéfan van der Walt wrote:
> Hi Bruce
> 2009/9/14 Bruce Southey<bsouthey@gmail.com>:
>> I would like to change the dtype of just one field of a structured or
>> record array without copying the original array. I can not change the
>> creation of the original array because it was created using genfromtxt.
> You can't do that, unfortunately.  You can view the array using any
> dtype of the same length as the old one, but you can't modify the
> length of single elements without re-allocation.
> Regards
> Stéfan


More information about the NumPy-Discussion mailing list