<p dir="auto">I would be willing to contribute a median absolute deviation function to scipy.stats, if there is a broader interest. There are other robust measures of variance (<code class="notranslate">tvar</code> and <code class="notranslate">iqr</code>) and I think the <code class="notranslate">mad</code> function would complement these nicely.</p>
<p dir="auto">Some functions like <code class="notranslate">linregress</code> and <code class="notranslate">theilslopes</code> return tuples of 4 or 5 results. A <code class="notranslate">Bunch</code> pattern would be much cleaner, and also allows adding extra return values easily.</p>
<p dir="auto">See discussion at <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rgommers/scipy/commit/6c1048f6416/hovercard" href="https://github.com/rgommers/scipy/commit/6c1048f6416">rgommers@<tt>6c1048f6416</tt></a> with <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/josef-pkt/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/josef-pkt">@josef-pkt</a></p>