[Numpy-discussion] Viewing a float64 array with a float32 array

Hugo Gagnon sourceforge.numpy@user.fastmail...
Wed Mar 21 10:09:55 CDT 2012


Is it possible to have a view of a float64 array that is itself float32?
So that:

>>> A = np.arange(5, dtype='d')
>>> A.view(dtype='f')

would return a size 5 float32 array looking at A's data?

  Hugo Gagnon

More information about the NumPy-Discussion mailing list