[pypy-issue] [issue1660] numpy: triu_indices, tril_indices fails with AttributeError: 'ufunc' object has no attribute 'outer'

Anders Kaseorg tracker at bugs.pypy.org
Sun Dec 15 05:29:28 CET 2013


New submission from Anders Kaseorg <andersk at mit.edu>:

Although http://buildbot.pypy.org/numpy-status/latest.html claims that triu_indices and tril_indices should work, 
they don’t:

Python 2.7.3 (55f7a6da11c7, Dec 14 2013, 23:00:23)
[PyPy 2.3.0-alpha0 with GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``it is the expected behavior,
except when you don't expect it''
>>>> import numpy as np
>>>> np.triu_indices(4)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/anders/pypy-nightly-env/site-packages/numpy/lib/twodim_base.py", line 900, in triu_indices
    return mask_indices(n, triu, k)
  File "/home/anders/pypy-nightly-env/site-packages/numpy/lib/twodim_base.py", line 723, in mask_indices
    a = mask_func(m, k)
  File "/home/anders/pypy-nightly-env/site-packages/numpy/lib/twodim_base.py", line 450, in triu
    out = multiply((1 - tri(m.shape[0], m.shape[1], k - 1, dtype=m.dtype)), m)
  File "/home/anders/pypy-nightly-env/site-packages/numpy/lib/twodim_base.py", line 388, in tri
    m = greater_equal(subtract.outer(arange(N), arange(M)), -k)
AttributeError: 'ufunc' object has no attribute 'outer'

----------
messages: 6422
nosy: andersk, pypy-issue
priority: bug
status: unread
title: numpy: triu_indices, tril_indices fails with AttributeError: 'ufunc' object has no attribute 'outer'

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1660>
________________________________________


More information about the pypy-issue mailing list