<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Dear Tom,</span></div><div><span>You are completely right. I sent a message on Numpy-discussion.</span></div><div><span><a href="http://mail.scipy.org/pipermail/numpy-discussion/2013-January/065213.html">http://mail.scipy.org/pipermail/numpy-discussion/2013-January/065213.html</a></span></div><div><span>Let's see what happens..</span></div><div><span>Cheers</span></div><div><span>Jerome</span></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> <div style="margin: 5px 0px; padding: 0px; border: 1px solid rgb(204, 204, 204); height: 0px; line-height: 0; font-size: 0px;" class="hr" contentEditable="false" readonly="true"></div>  <b><span
 style="font-weight: bold;">De :</span></b> Thomas Robitaille <thomas.robitaille@gmail.com><br> <b><span style="font-weight: bold;">À :</span></b> Jerome Caron <jerome_caron_astro@ymail.com> <br><b><span style="font-weight: bold;">Cc :</span></b> "astropy@scipy.org list" <astropy@scipy.org> <br> <b><span style="font-weight: bold;">Envoyé le :</span></b> Mardi 15 janvier 2013 11h29<br> <b><span style="font-weight: bold;">Objet :</span></b> Re: [AstroPy] Missing some statistical method for your astronomy analyses in Python?<br> </font> </div> <br>I think this is something that should be brought up with the Numpy<br>developers, and it would probably benefit everyone to have a faster<br>median calculation function (not just astronomers). At the moment,<br>Numpy just uses a quicksort, but if one could achieve speedups of 5x,<br>then I think the Numpy devs might be interested.<br><br>Cheers,<br>Tom<br><br>On 15 January
 2013 10:51, Jerome Caron <<a href="mailto:jerome_caron_astro@ymail.com" ymailto="mailto:jerome_caron_astro@ymail.com">jerome_caron_astro@ymail.com</a>> wrote:<br>> Dear Christoph<br>> I think the calculation of median values in Numpy is not optimal. I don't<br>> know if there are other libraries that do better?<br>> On my machine I get these results:<br>>>>> data = numpy.random.rand(5000,5000)<br>>>>> t0=time.time();print numpy.ma.median(data);print time.time()-t0<br>> 0.499845739822<br>> 15.1949999332<br>>>>> t0=time.time();print numpy.median(data);print time.time()-t0<br>> 0.499845739822<br>> 4.32100009918<br>>>>> t0=time.time();print aspylib.astro.get_median(data);print time.time()-t0<br>> [ 0.49984574]<br>> 0.90499997139<br>>>>><br>> The median calculation in Aspylib is using C code from Nicolas Devillard<br>> (can be found here: <a
 href="http://ndevilla.free.fr/median/index.html" target="_blank">http://ndevilla.free.fr/median/index.html</a>) interfaced<br>> with ctypes.<br>> It could be easily re-used for other, more official packages. I think the<br>> code also finds quantiles efficiently.<br>> Kind regards<br>> Jerome Caron<br>><br>> De : Christoph Deil <<a href="mailto:deil.christoph@googlemail.com" ymailto="mailto:deil.christoph@googlemail.com">deil.christoph@googlemail.com</a>><br>> À : "<a href="mailto:astropy@scipy.org" ymailto="mailto:astropy@scipy.org">astropy@scipy.org</a> list" <<a href="mailto:astropy@scipy.org" ymailto="mailto:astropy@scipy.org">astropy@scipy.org</a>><br>> Envoyé le : Mardi 15 janvier 2013 8h42<br>> Objet : [AstroPy] Missing some statistical method for your astronomy<br>> analyses in Python?<br>><br>> Dear all,<br>><br>> we would like to know which statistical methods you want to use for
 you<br>> astronomy work with Python that are not readily available e.g. in scipy or<br>> one of the existing scientific Python packages like e.g. statsmodels,<br>> scikit-learn, astroML, …<br>><br>> Please visit the wiki page for what has already been suggested, then reply<br>> to this email or make an addition to the<br>> <a href="https://github.com/astropy/astropy/wiki/What-methods-do-we-want-in-astropy.stats" target="_blank">https://github.com/astropy/astropy/wiki/What-methods-do-we-want-in-astropy.stats</a>?<br>> wiki page directly.<br>><br>> The plan is to add these methods either to astropy.stats or, if they are not<br>> astronomy-specific, to one of the existing scientific Python packages.<br>><br>> Christoph<br>><br>> PS: This discussion started as a thread on astropy-dev (<br>> <a href="https://groups.google.com/d/topic/astropy-dev/Zwgafam171E/discussion"
 target="_blank">https://groups.google.com/d/topic/astropy-dev/Zwgafam171E/discussion</a> ), but<br>> it was suggested to also ask here.<br>><br>> _______________________________________________<br>> AstroPy mailing list<br>> <a href="mailto:AstroPy@scipy.org" ymailto="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a><br>> <a href="http://mail.scipy.org/mailman/listinfo/astropy" target="_blank">http://mail.scipy.org/mailman/listinfo/astropy</a><br>><br>><br>><br>> _______________________________________________<br>> AstroPy mailing list<br>> <a href="mailto:AstroPy@scipy.org" ymailto="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a><br>> <a href="http://mail.scipy.org/mailman/listinfo/astropy" target="_blank">http://mail.scipy.org/mailman/listinfo/astropy</a><br>><br><br><br> </div> </div>  </div></body></html>