[Numpy-discussion] Different behavior for astype('str') in numpy 1.5.1 vs 1.6.0?

Skipper Seabold jsseabold@gmail....
Mon Feb 21 14:09:05 CST 2011


I get a lot of errors and failures running our tests with most recent
numpy trunk. One in particular (so far) seems to be a bug.

In [1]: import numpy as np

In [2]: np.__version__
Out[2]: '1.6.0.dev-c50af53'

In [3]: tmp_arr = np.array([['black'],['white'],['other']])

In [4]: tmp_arr.astype('str')
Out[4]:
array([['b'],
       ['w'],
       ['o']],
      dtype='|S1')

The old behavior

In [1]: import numpy as np

In [2]: np.__version__
Out[2]: '1.5.1'

In [3]: tmp_arr = np.array([['black'],['white'],['other']])

In [4]: tmp_arr.astype('str')
Out[4]:
array([['black'],
       ['white'],
       ['other']],
      dtype='|S5')

Should I file a ticket?

Skipper

PS. Is there an incompatibility of numpy 1.5.1 and numpy 1.6.0 trunk
for packages that depend on numpy?


More information about the NumPy-Discussion mailing list