[Numpy-discussion] Request for a bit more info on structured arrays in the "basics" page

Pauli Virtanen pav at iki.fi
Thu Mar 10 04:21:04 EST 2011


Thu, 10 Mar 2011 15:23:59 +0800, Ralf Gommers wrote:
[clip]
>> x = np.array([1.5])
>> x.view(int)
>> array([4609434218613702656])

Yes, `view` is meant to do exactly that. Use `astype` if you want a type 
cast.

	Pauli





More information about the NumPy-Discussion mailing list