<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 2, 2019 at 1:45 PM Filippo Bovo <<a href="mailto:hi.hellbee@gmail.com">hi.hellbee@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 style="overflow-wrap: break-word;"><div>Hi,</div><div><br></div><div>I wrote a Python package for the high-performance calculation of three robust statistical estimators: weighted median, medcouple and mode.</div><div><br></div><div>The repository with the code is at this link: <a href="https://github.com/FilippoBovo/robustats" target="_blank">https://github.com/FilippoBovo/robustats</a>.</div><div><br></div><div>The estimators are implemented in C using linear or log-linear algorithms, thereby making the code run pretty fast.</div><div><br></div><div>I would like to donate the code for the above three estimators to SciPy. </div></div></blockquote><div><br></div><div>Hi Filippo. Thanks for your interest in contributing!</div><div> <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 style="overflow-wrap: break-word;"><div>I believe that `scipy.stats` is a good location where to add the weighted median, medcouple and mode.</div></div></blockquote><div><br></div><div>There is a mode function in scipy.stats. It looks nontrivial to make that work in C in a backwards-compatible fashion, but please have a look at it and see if that can work and would be an improvement.</div><div><br></div><div>I've looked at your medcouple, but the function doesn't explain what it's for and I'm not familiar with the name. Can you explain?</div><div><br></div><div>A weighted median doesn't fit well. NumPy has a median function, perhaps better to consider whether to add weights to that, in the same fashion as for numpy.average</div><div><br></div><div>Cheers,<br></div><div>Ralf</div><div><br></div></div></div>