[Numpy-discussion] Was the range() function ever created?

C W tmrsg11 at gmail.com
Sat May 25 01:05:30 EDT 2019


I somehow missed Juan's reply.

Yes, I think Juan solved the problem.

Thanks, Juan!

On Sat, May 25, 2019 at 12:57 AM Robert Kern <robert.kern at gmail.com> wrote:

> On Fri, May 24, 2019 at 9:33 PM C W <tmrsg11 at 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 at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20190525/98eefc98/attachment.html>


More information about the NumPy-Discussion mailing list