Dear all,
I just ran into a bug in sage, which is reproducible both in my local Sage 6.3, 6.5 and on sage-cloud using the sage notebook but not when using iPython, i.e. it seems to really be a sage bug, not a numpy bug.
Any ideas what might be the reason?
Just using the syntax from the numpy.percentile docstring gives:
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.3, Release Date: 2014-08-10 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: import numpy as np
sage: a = np.array([[10, 7, 4], [3, 2, 1]])
sage: np.percentile(a, 75)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-4-54a2b61d0a48> in <module>()
----> 1 np.percentile(a, Integer(75))
/home/sschyman/Programs/sage/local/lib/python2.7/site-packages/numpy/lib/function_base.py in percentile(a, q, axis, out, overwrite_input)
2818 axis = 0
2819
-> 2820 return _compute_qth_percentile(sorted, q, axis, out)
2821
2822 # handle sequence of q's without calling sort multiple times
/home/sschyman/Programs/sage/local/lib/python2.7/site-packages/numpy/lib/function_base.py in _compute_qth_percentile(sorted, q, axis, out)
2824 if not isscalar(q):
2825 p = [_compute_qth_percentile(sorted, qi, axis, None)
-> 2826 for qi in q]
2827
2828 if out is not None:
TypeError: 'sage.rings.integer.Integer' object is not iterable
Cheers
Stan