[Numpy-discussion] Bug in numpy.fix(): broken for scalar arguments

Eric Firing efiring@hawaii....
Sat Apr 17 15:01:10 CDT 2010


np.fix() no longer works for scalar arguments:


In [1]:import numpy as np

In [2]:np.version.version
Out[2]:'2.0.0.dev8334'

In [3]:np.fix(3.14)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/efiring/<ipython console> in <module>()

/usr/local/lib/python2.6/dist-packages/numpy/lib/ufunclike.pyc in fix(x, y)
      46     if y is None:
      47         y = y1
---> 48     y[...] = nx.where(x >= 0, y1, y2)
      49     return y
      50

TypeError: 'numpy.float64' object does not support item assignment


Eric


More information about the NumPy-Discussion mailing list