<div dir="ltr"><div>Dear Lucas,</div><div><br></div><div>I want the ability to reuse the bin numbers for a new input dataset.</div><div><br></div><div>Indeed one should already be able to compute several statistics at once (and also for several datasets available at the same time).<br></div><div><br></div><div>I have a PR ready to submit.</div><div>Thank you for proposing to review it.<br></div><div><br></div><div>Best regards,</div><div><br></div><div>Edouard<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 18, 2019 at 9:59 PM <<a href="mailto:rlucas7@vt.edu">rlucas7@vt.edu</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"> <br>
> On Sep 18, 2019, at 9:45 AM, <a href="mailto:scipy-dev-request@python.org" target="_blank">scipy-dev-request@python.org</a> wrote:<br>
> <br>
> Send SciPy-Dev mailing list submissions to<br>
> <a href="mailto:scipy-dev@python.org" target="_blank">scipy-dev@python.org</a><br>
> <br>
> To subscribe or unsubscribe via the World Wide Web, visit<br>
> <a href="https://mail.python.org/mailman/listinfo/scipy-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scipy-dev</a><br>
> or, via email, send a message with subject or body 'help' to<br>
> <a href="mailto:scipy-dev-request@python.org" target="_blank">scipy-dev-request@python.org</a><br>
> <br>
> You can reach the person managing the list at<br>
> <a href="mailto:scipy-dev-owner@python.org" target="_blank">scipy-dev-owner@python.org</a><br>
> <br>
> When replying, please edit your Subject line so it is more specific<br>
> than "Re: Contents of SciPy-Dev digest..."<br>
> <br>
> <br>
> Today's Topics:<br>
> <br>
> 1. Re: improvement to binned statistic (Ralf Gommers)<br>
> 2. Adding alpha complexes/filtrations to scipy.spatial?<br>
> (Hamilton, Wesley)<br>
> 3. Re: Improvement to regular grid interpolation (Simon S. Clift)<br>
> <br>
> <br>
> ----------------------------------------------------------------------<br>
> <br>
> Message: 1<br>
> Date: Wed, 18 Sep 2019 15:02:17 +0200<br>
> From: Ralf Gommers <<a href="mailto:ralf.gommers@gmail.com" target="_blank">ralf.gommers@gmail.com</a>><br>
> To: SciPy Developers List <<a href="mailto:scipy-dev@python.org" target="_blank">scipy-dev@python.org</a>><br>
> Subject: Re: [SciPy-Dev] improvement to binned statistic<br>
> Message-ID:<br>
> <<a href="mailto:CABL7CQhHJ-qJmbNnmJeGYATLKZQZCc6z9EB-RivXxKBUo8pscA@mail.gmail.com" target="_blank">CABL7CQhHJ-qJmbNnmJeGYATLKZQZCc6z9EB-RivXxKBUo8pscA@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="utf-8"<br>
> <br>
> Hi Edouard,<br>
> <br>
> <br>
> On Wed, Sep 18, 2019 at 11:29 AM Edouard Goudenhoofdt <<a href="mailto:egouden@gmail.com" target="_blank">egouden@gmail.com</a>><br>
> wrote:<br>
> <br>
>> Dear scipy developers,<br>
>> <br>
>> One could use scipy.stats.binned_statistic_dd for the same sample points<br>
>> but for values available at different times.<br>
>> Currently this involves the computation of the bin numbers every time the<br>
>> function is called.<br>
>> Therefore I would like to add an optional argument "binnumbers" to skip<br>
>> this step when calling the function again.<br>
>> <br>
> <br>
> That seems sensible. Could you check that creating the bin numbers really<br>
> takes the majority of the time? There's also a fair amount of input<br>
> validation that shouldn't be skipped even when a new `binnumbers` is passed<br>
> in. If that is the case, sending a PR with a benchmark would be very<br>
> welcome.<br>
> <br>
> Cheers,<br>
> Ralf<br>
<br>
IIUC Edouard what you’d like to do is take input data, run binned_statistic_dd() and then do the same thing with the bin edges calculated from this first call either on a new input dataset or on the same data(perhaps calculating on a new statistic?). <br>
<br>
AFAIK the binned_statistic_dd() function isn’t able to take binedges as an argument. If you want multiple stats for the same data I think you can achieve that via a custom callable() that returns multiple statistics rather than a single scalar, but I haven’t done this so you should confirm that the approach would work fine. <br>
<br>
If you want to take that up I’m happy to review the PR. <br>
<br>
If not, and this is something others agree is useful and should be implemented, it seems reasonable to do. I can implement if you don’t have time or are otherwise unable to open a PR. <br>
<br>
Let me know either way. <br>
<br>
-Lucas Roberts<br>
_______________________________________________<br>
SciPy-Dev mailing list<br>
<a href="mailto:SciPy-Dev@python.org" target="_blank">SciPy-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scipy-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/scipy-dev</a><br>
</blockquote></div>