Can I resurrect this thread then by agreeing with Chris, and my
original post, that it would be better if median had the same behavior
as mean, accepting axis and dtype as inputs?

Best,

Matthew

On 5/24/07, Christopher Barker <[EMAIL PROTECTED]> wrote:
> Sven Schreiber wrote:
> >> (Zar, Jerrold H. 1984. Biostatistical Analysis. Prentice Hall.)
> >
> > Is that the seminal work on the topic ;-)
>
> Of course not, just a reference I have handy -- though I suppose there
> are any number of them on the web too.
>
> >> Of course, the median of an odd number of integers would be an integer.
>
> > that's why I asked about _forcing_ to a float
>
> To complete the discussion:
>
>  >>> a = N.arange(4)
>  >>> type(N.median(a))
> <type 'numpy.float64'>
>  >>> a = N.arange(4)
>  >>> N.median(a)
> 1.5
>  >>> type(N.median(a))
> <type 'numpy.float64'>
>  >>> a = N.arange(5)
>  >>> N.median(a)
> 2
>  >>> type(N.median(a))
> <type 'numpy.int32'>
>
> So median converts to a float if it needs to, and keeps it an integer
> otherwise, which seems reasonable to me, though it would be nice to
> specify a dtype, so that you can make sure you always get a float if you
> want one.
>
> -Chris
>
>
> --
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R            (206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115       (206) 526-6317   main reception
>
> [EMAIL PROTECTED]
> _______________________________________________
> Numpy-discussion mailing list
> [email protected]
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to