[SciPy-dev] Depreciating functions in scipy.stats

josef.pktd@gmai... josef.pktd@gmai...
Mon Mar 2 14:47:30 CST 2009

On Mon, Mar 2, 2009 at 2:09 PM, Bruce Southey <bsouthey@gmail.com> wrote:
> Hi,
> I am seeing a few functions that should be made depreciated as these
> appear to duplicate Numpy or Scipy functions.
> Do you want these as new or old tickets (for example, samplestd has
> ticket #81 as part of the Statistics Review)?
> Would you want a large patch or one for each ticket?

I agree with all the depreciation, and there might be some more (eg. sem and
stderr are essentially the same). For depreciation warnings I would prefer
one new ticket with one patch (or easier for me to verify is the
changed complete
sourcefile of stats.py)

> These functions are just renamed functions present in scipy.special just
> with perhaps slightly more informative names:
> erfc
> ksprob
> fprob
> chisqprob
> zprob

Most calls to these functions can be replaced to calls to the distribution, e.g
distributions.f.sf, as I did for the t-tests. However, I have seen them used in
some external packages, and a release with a depreciation warning might be

> But I do not think we need these as separate functions but there is the
> issue of depreciation involved if users use these specific functions.
> There are other like that should be treated as depreciated:
> samplestd
> samplevar
>  >>> import numpy as np
>  >>> import scipy.stats.stats as stats
>  >>> a=np.array([[1,2,3,4,5], [6,7,8,9,10]])
>  >>> np.std(a,axis=0)
> array([ 2.5,  2.5,  2.5,  2.5,  2.5])
>  >>> stats.samplestd(a,axis=0)
> array([ 2.5,  2.5,  2.5,  2.5,  2.5])
>  >>> stats.samplestd(a,axis=None)
> 2.8722813232690143
>  >>> np.std(a,axis=None)
> 2.8722813232690143
> Also, stats.py has the histogram and histogram2 functions where I agree
> with the comment in the code about being obsoleted by numpy.histogram.
> I would think these should be depreciated although the cumfreq and
> relfreq functions would need to be rewritten,

I never looked closely at the histogram and histogram2 functions in stats,
because I also use the numpy version. So I don't know if they have
equivalent functionality.
Neither the histogram functions nor cumfreq and relfreq have tests, so
before depreciating we should find out what these functions are doing
for different cases.

> Thanks
> Bruce

Thank you for checking this


More information about the Scipy-dev mailing list