[Numpy-discussion] floats as axis

Charles R Harris charlesr.harris@gmail....
Wed Apr 28 11:59:04 CDT 2010


On Wed, Apr 28, 2010 at 8:44 AM, Travis Oliphant <oliphant@enthought.com>wrote:

>
> On Apr 25, 2010, at 8:16 AM, josef.pktd@gmail.com wrote:
>
> > (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
>
>
> I think we should make float inputs raise an error for NumPy 2.0
>
>
Agree... Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100428/225b3b6e/attachment.html 


More information about the NumPy-Discussion mailing list