[Numpy-discussion] bug?

Peter Verveer verveer at embl-heidelberg.de
Mon Aug 18 05:03:08 CDT 2003


Consider conversion of a slice using the astype() method:

>>> a = array([[1,2],[3,4]])
>>> b = a[1, ...]
>>> print b
[3 4]

Conversion using the astype() method goes wrong:

>>> print b.astype(Float32)
[ 1.  2.]

This fixes it:

>>> print b.copy().astype(Float32)
[ 3.  4.]

A bug?

Cheers, Peter

-- 
Dr. Peter J. Verveer
Cell Biology and Cell Biophysics Programme
EMBL
Meyerhofstrasse 1
D-69117 Heidelberg
Germany
Tel. : +49 6221 387245
Fax  : +49 6221 387242
Email: Peter.Verveer at embl-heidelberg.de






More information about the Numpy-discussion mailing list