<div dir="ltr"><div>I somehow missed Juan's reply.</div><div><br></div><div>Yes, I think Juan solved the problem.<br></div><div><br></div><div>Thanks, Juan!<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 25, 2019 at 12:57 AM Robert Kern <<a href="mailto:robert.kern@gmail.com">robert.kern@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Fri, May 24, 2019 at 9:33 PM C W <<a href="mailto:tmrsg11@gmail.com" target="_blank">tmrsg11@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thank you, Robert. I will take it up to the Pandas-dev mailing list.</div><div><br></div><div>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.<br></div><div><br></div><div>I'm not an expert, but wouldn't something like this do?<br></div><div>def range(vec):</div><div>   return np.max(vec) - np.min(vec)</div></div>
</blockquote></div><div><br></div>Oh.You referenced the R range() function, which returns the minimum and the maximum as separate numbers, not their difference.<div><br></div><div>  <a href="https://www.rdocumentation.org/packages/base/versions/3.6.0/topics/range" target="_blank">https://www.rdocumentation.org/packages/base/versions/3.6.0/topics/range</a><br clear="all"><div><br></div><div>And the pandas issue that you referenced was asking for the same.</div><div><br></div><div>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).</div><div><br></div>-- <br><div dir="ltr" class="gmail-m_-1585789238452603675gmail_signature">Robert Kern</div></div></div>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@python.org" target="_blank">NumPy-Discussion@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div>