I'm really surprised that there are no mad function built into the numpy!
It's just not that often used. statsmodels
has a MAD implementation, please use that one.
Why should I use a different library just for one function. I do not understand why you refuse to add it while it is very easy to implement. It takes just a couple of lines!
Why should I use a different library just for one function.
That argument can be used for lots and lots of functions. we don't just add anything to numpy, it has to be useful to a wide enough audience. Robust statistics don't meet that bar; statsmodels
or scipy.stats
are the places to add such stats-specific functionality.
It takes just a couple of lines!
You can then very easily just define it yourself when you need it, if you don't want to use statsmodels
.