Hi All, I'm fiddling with some endianness / binary representation issue and stumbled upon this puzzling behavior of astype(): It does not seem to work as expected - for me at least ;) - when given a scalar:
>>> import numpy as np >>> np.array(42).astype(">i4").dtype dtype('>i4') >>> np.array(42, dtype=">i4").astype('>i4').dtype dtype('int32') >>> >>> np.array([42]).astype(">i4").dtype dtype('>i4') >>> np.array([42], dtype=">i4").astype('>i4').dtype dtype('>i4') Shouldn't I always get dtype('>i4')? Regards, Lorenz PS: >>> np.version.version '1.4.0.dev7417' _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion