

Hello all,
Response at the time was to use df.describe(). But df.describe() gives all the 5number summary statistics, but I DON'T WANT wall the extra stuff I didn't ask for. I was expected a numerical number. I can use that to feed into another function.
It exists in Matlab and R, why not in Python? I'm quite frustrated every time I need to calculate the range.
Thanks in advance.
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion


This is the numpy discussion list, not the pandas discussion list. Now, for numpy's part, I have had hankerings for a `np.minmax()` ufunc, but never enough to get over just calling min and max on my data separately.
Hello all,
Response at the time was to use df.describe(). But df.describe() gives all the 5number summary statistics, but I DON'T WANT wall the extra stuff I didn't ask for. I was expected a numerical number. I can use that to feed into another function.
It exists in Matlab and R, why not in Python? I'm quite frustrated every time I need to calculate the range.
Thanks in advance.
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion


When I looked up pandas mailing list. Numpy showed up. Maybe is because Pandas is built on Numpy? My apologies.
Yes, please do. For people with statistical background, but not CS. It seems strange the *real* range() function is used to generate natural numbers.
Thanks, Ben!
On Fri, May 24, 2019 at 10:34 PM Benjamin Root < [hidden email]> wrote: This is the numpy discussion list, not the pandas discussion list. Now, for numpy's part, I have had hankerings for a `np.minmax()` ufunc, but never enough to get over just calling min and max on my data separately.
Hello all,
Response at the time was to use df.describe(). But df.describe() gives all the 5number summary statistics, but I DON'T WANT wall the extra stuff I didn't ask for. I was expected a numerical number. I can use that to feed into another function.
It exists in Matlab and R, why not in Python? I'm quite frustrated every time I need to calculate the range.
Thanks in advance.
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion


pandas is not built on numpy (at least, not anymore), but borrows a lot of inspirations from numpy, and interacts with numpy fairly well. As part of the scipy ecosystem, we all work together to improve interoperability and features.
python's builtin range() function has been there long before numpy came on the scene, so it just made sense to adopt that name since it was the way to generate numbers in python.
Ben
When I looked up pandas mailing list. Numpy showed up. Maybe is because Pandas is built on Numpy? My apologies.
Yes, please do. For people with statistical background, but not CS. It seems strange the *real* range() function is used to generate natural numbers.
Thanks, Ben!
On Fri, May 24, 2019 at 10:34 PM Benjamin Root < [hidden email]> wrote: This is the numpy discussion list, not the pandas discussion list. Now, for numpy's part, I have had hankerings for a `np.minmax()` ufunc, but never enough to get over just calling min and max on my data separately.
Hello all,
Response at the time was to use df.describe(). But df.describe() gives all the 5number summary statistics, but I DON'T WANT wall the extra stuff I didn't ask for. I was expected a numerical number. I can use that to feed into another function.
It exists in Matlab and R, why not in Python? I'm quite frustrated every time I need to calculate the range.
Thanks in advance.
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion


I can't be the first person who asked about range() that calculates the *actual* range of two numbers.
I have not used numpy or pandas long enough to know, but how has it been dealt with before?
On Fri, May 24, 2019 at 11:10 PM Benjamin Root < [hidden email]> wrote: pandas is not built on numpy (at least, not anymore), but borrows a lot of inspirations from numpy, and interacts with numpy fairly well. As part of the scipy ecosystem, we all work together to improve interoperability and features.
python's builtin range() function has been there long before numpy came on the scene, so it just made sense to adopt that name since it was the way to generate numbers in python.
Ben
When I looked up pandas mailing list. Numpy showed up. Maybe is because Pandas is built on Numpy? My apologies.
Yes, please do. For people with statistical background, but not CS. It seems strange the *real* range() function is used to generate natural numbers.
Thanks, Ben!
On Fri, May 24, 2019 at 10:34 PM Benjamin Root < [hidden email]> wrote: This is the numpy discussion list, not the pandas discussion list. Now, for numpy's part, I have had hankerings for a `np.minmax()` ufunc, but never enough to get over just calling min and max on my data separately.
Hello all,
Response at the time was to use df.describe(). But df.describe() gives all the 5number summary statistics, but I DON'T WANT wall the extra stuff I didn't ask for. I was expected a numerical number. I can use that to feed into another function.
It exists in Matlab and R, why not in Python? I'm quite frustrated every time I need to calculate the range.
Thanks in advance.
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion


On Sat, 25 May 2019, at 1:49 PM, C W wrote:
I can't be the first person who asked about range() that calculates the *actual* range of two numbers.
Based on your mention of matlab's `range`, I think you're looking for numpy.ptp.
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion


I can't be the first person who asked about range() that calculates the *actual* range of two numbers.
I have not used numpy or pandas long enough to know, but how has it been dealt with before?
First, through `describe()`, then they added `value_range()`, then they deprecated `value_range()` in favor of `describe()` again.
As for numpy, trying to come up with the right semantics for the shape of the output is usually when such discussions die. Functions like a statistical range calculation are expected to be like `min()` and `max()` and allow us to apply them axiswise (e.g. just down columns or just across rows, or more any other axis in an ND array). Odds are, the way that we'll pack the two results into a single output will probably not be what you want in half of the cases, so you'll just have to unpack anyways, and at that point, it's just not that much more convenient than calling `min()` and `max()` separately. So every time we write `xmin, xmax = x.min(), x.max()`, we grumble a little bit, but it's just a grumble, not a significant pain.
pandas has other considerations, but you'll have to ask them.
 Robert Kern
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion


Thank you, Robert. I will take it up to the Pandasdev 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)
I can't be the first person who asked about range() that calculates the *actual* range of two numbers.
I have not used numpy or pandas long enough to know, but how has it been dealt with before?
First, through `describe()`, then they added `value_range()`, then they deprecated `value_range()` in favor of `describe()` again.
As for numpy, trying to come up with the right semantics for the shape of the output is usually when such discussions die. Functions like a statistical range calculation are expected to be like `min()` and `max()` and allow us to apply them axiswise (e.g. just down columns or just across rows, or more any other axis in an ND array). Odds are, the way that we'll pack the two results into a single output will probably not be what you want in half of the cases, so you'll just have to unpack anyways, and at that point, it's just not that much more convenient than calling `min()` and `max()` separately. So every time we write `xmin, xmax = x.min(), x.max()`, we grumble a little bit, but it's just a grumble, not a significant pain.
pandas has other considerations, but you'll have to ask them.
 Robert Kern
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion


Thank you, Robert. I will take it up to the Pandasdev 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.
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion


I somehow missed Juan's reply.
Yes, I think Juan solved the problem.
Thanks, Juan!
Thank you, Robert. I will take it up to the Pandasdev 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.
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion
_______________________________________________
NumPyDiscussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpydiscussion

