On Fri, May 24, 2019 at 9:33 PM C W <tmrs...@gmail.com> wrote:

> Thank you, Robert. I will take it up to the Pandas-dev mailing list.
>
> I'm not sure if I follow you on "right semantics for the shape of the
> output." Range is just a summary statistic which is a number.
>
> I'm not an expert, but wouldn't something like this do?
> def range(vec):
>    return np.max(vec) - np.min(vec)
>

Oh.You referenced the R range() function, which returns the minimum and the
maximum as separate numbers, not their difference.

  https://www.rdocumentation.org/packages/base/versions/3.6.0/topics/range

And the pandas issue that you referenced was asking for the same.

In fact, numpy does have the function you are looking for, as Juan noted.
It's called `ptp()` (early numpy developers tended to be more from a signal
processing background than a statistics background).

-- 
Robert Kern
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to