(some) numpy functions take floats as valid axis argument. Is this a feature?

>>> np.ones((2,3)).sum(1.2)
array([ 3.,  3.])
>>> np.ones((2,3)).sum(1.99)
array([ 3.,  3.])

>>> np.mean((1.5,0.5))
1.0
>>> np.mean(1.5,0.5)
1.5

Keith pointed out that scipy.stats.nanmean has a different behavior

>>> stats.nanmean(np.ones((2,3)), axis= 1.2)
Traceback (most recent call last):
<...>
TypeError: tuple indices must be integers

see: http://projects.scipy.org/scipy/ticket/1165

What's the preferred behavior?

Josef
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to