Re: ANN: stats 0.1a calculator statistics for Python

2010-10-19 Thread Chris Torek
>2010/10/17 Steven D'Aprano :
>> http://pypi.python.org/pypi/stats

In article 
Vlastimil Brom   wrote:
>Thanks for this useful module!
>I just wanted to report a marginal error triggered in the doctests:
>
>Failed example:
>isnan(float('nan'))
>Exception raised:
>Traceback (most recent call last):
>  File "C:\Python25\lib\doctest.py", line 1228, in __run
>compileflags, 1) in test.globs
>  File "", line 1, in 
>isnan(float('nan'))
>ValueError: invalid literal for float(): nan
>
>(python 2.5.4 on win XP; this might be OS specific; probably in the
>newer versions float() was updated, the tests on 2.6 and 2.7 are ok ):

Indeed it was; in older versions float() just invoked the C library
routines, so float('nan') works on Mac OS X python 2.5, for instance,
but then you run into the fact that math.isnan() is only in 2.6 and
later :-)

Workaround, assuming an earlier "from math import *":

try:
isnan(0.0)
except NameError:
def isnan(x): x != x

Of course you are still stuck with float('nan') failing on Windows.
I have no quick and easy workaround for that one.
-- 
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W)  +1 801 277 2603
email: gmail (figure it out)  http://web.torek.net/torek/index.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: stats 0.1a calculator statistics for Python

2010-10-19 Thread Jean-Michel Pichavant

Steven D'Aprano wrote:

On Tue, 19 Oct 2010 11:53:40 +1100, Ben Finney wrote:

  

Steven D'Aprano  writes:



On Mon, 18 Oct 2010 11:56:39 +0200, Jean-Michel Pichavant wrote:

  

I already have a stats module:
/usr/lib/python2.5/site-packages/stats.py


The name of my module is not set in stone.

I can't help what site-packages you have, but the above is not on PyPI,
and it's certainly not part of the standard library.
  

How did you determine that? Unfortunately, the name of the package
listed on PyPI bears no relation to the name of packages installed into
Python.



Fair point. 



  

It's part of the debian distribution. Just sayin so you know :).

apt-cache showpkg python-stats
Package: python-stats
Versions:
0.6-7 
(/var/lib/apt/lists/apt-cache.sequans.com_debian_dists_lenny_main_binary-i386_Packages) 
(/var/lib/dpkg/status)



JM
--
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: stats 0.1a calculator statistics for Python

2010-10-18 Thread Steven D'Aprano
On Tue, 19 Oct 2010 11:53:40 +1100, Ben Finney wrote:

> Steven D'Aprano  writes:
> 
>> On Mon, 18 Oct 2010 11:56:39 +0200, Jean-Michel Pichavant wrote:
>>
>> > I already have a stats module:
>> > /usr/lib/python2.5/site-packages/stats.py
>>
>> The name of my module is not set in stone.
>>
>> I can't help what site-packages you have, but the above is not on PyPI,
>> and it's certainly not part of the standard library.
> 
> How did you determine that? Unfortunately, the name of the package
> listed on PyPI bears no relation to the name of packages installed into
> Python.

Fair point. 



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: stats 0.1a calculator statistics for Python

2010-10-18 Thread Ben Finney
Steven D'Aprano  writes:

> On Mon, 18 Oct 2010 11:56:39 +0200, Jean-Michel Pichavant wrote:
>
> > I already have a stats module:
> > /usr/lib/python2.5/site-packages/stats.py
>
> The name of my module is not set in stone.
>
> I can't help what site-packages you have, but the above is not on
> PyPI, and it's certainly not part of the standard library.

How did you determine that? Unfortunately, the name of the package
listed on PyPI bears no relation to the name of packages installed into
Python.

So IIUC your claim above can only be verified by checking what package
names actually get installed by each package on PyPI.

-- 
 \“Of course, everybody says they're for peace. Hitler was for |
  `\  peace. Everybody is for peace. The question is: what kind of |
_o__)peace?” —Noam Chomsky, 1984-05-14 |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: stats 0.1a calculator statistics for Python

2010-10-18 Thread Steven D'Aprano
On Mon, 18 Oct 2010 11:56:39 +0200, Jean-Michel Pichavant wrote:

> I already have a stats module:
> /usr/lib/python2.5/site-packages/stats.py

The name of my module is not set in stone.

I can't help what site-packages you have, but the above is not on PyPI, 
and it's certainly not part of the standard library.

If my module (or one like it) gets accepted for the standard library, I 
don't think that could happen until version 3.3. When that happens, a 
name will be chosen. Until then, I've got the first package on PyPI 
called stats, and I'm keeping it :)

It may not stay stats forever, since it is uncomfortably close to the 
stat module.



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: stats 0.1a calculator statistics for Python

2010-10-18 Thread Vlastimil Brom
2010/10/17 Steven D'Aprano :
> I am pleased to announce the first public release of stats for Python.
>
> http://pypi.python.org/pypi/stats
>
> stats is a pure-Python module providing basic statistics functions
> similar to those found on scientific calculators. It currently includes:
>
> Univariate statistics including:
> * arithmetic, harmonic, geometric and quadratic means
> * median, mode
> * standard deviation and variance (sample and population)
>
> Multivariate statistics including:
> * Pearson's correlation coefficient
> * covariance (sample and population)
> * linear regression
>
> and others.
>
> This is an unstable alpha release of the software. Feedback and
> contributions are welcome.
>
>
>
> --
> Steven D'Aprano
> --
> http://mail.python.org/mailman/listinfo/python-list
>
Thanks for this useful module!
I just wanted to report a marginal error triggered in the doctests:

Failed example:
isnan(float('nan'))
Exception raised:
Traceback (most recent call last):
  File "C:\Python25\lib\doctest.py", line 1228, in __run
compileflags, 1) in test.globs
  File "", line 1, in 
isnan(float('nan'))
ValueError: invalid literal for float(): nan

(python 2.5.4 on win XP; this might be OS specific; probably in the
newer versions float() was updated, the tests on 2.6 and 2.7 are ok ):

I too would be interested in a comparison with the older module with
the same name:
http://www.nmr.mgh.harvard.edu/Neural_Systems_Group/gary/python.html
which is likely to be the same as the above mentioned one.

vbr
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: stats 0.1a calculator statistics for Python

2010-10-18 Thread Tim Wintle
On Sun, 2010-10-17 at 17:10 +, Steven D'Aprano wrote:
> I am pleased to announce the first public release of stats for Python.
> 
> http://pypi.python.org/pypi/stats

Quick comment on your sum() function:


http://docs.python.org/library/math.html#math.fsum

(in 2.6 and above)

should do the same thing, but faster.

It looks like a useful module though.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: stats 0.1a calculator statistics for Python

2010-10-18 Thread Jean-Michel Pichavant

Steven D'Aprano wrote:

I am pleased to announce the first public release of stats for Python.

http://pypi.python.org/pypi/stats

stats is a pure-Python module providing basic statistics functions 
similar to those found on scientific calculators. It currently includes:


Univariate statistics including:
* arithmetic, harmonic, geometric and quadratic means
* median, mode
* standard deviation and variance (sample and population)

Multivariate statistics including:
* Pearson's correlation coefficient
* covariance (sample and population)
* linear regression

and others.

This is an unstable alpha release of the software. Feedback and 
contributions are welcome.




  

I already have a stats module:
/usr/lib/python2.5/site-packages/stats.py

"""
stats.py module

(Requires pstat.py module.)

#
###  Written by:  Gary Strangman  ###
###  Last modified:  May 10, 2002 ###
#

A collection of basic statistical functions for python.  The function
names appear below.
[snip]
"""


It looks like it is part of the standard debian python distro (python 
2.5). That would mean that 'sats' is already used.


JM

--
http://mail.python.org/mailman/listinfo/python-list


ANN: stats 0.1a calculator statistics for Python

2010-10-17 Thread Steven D'Aprano
I am pleased to announce the first public release of stats for Python.

http://pypi.python.org/pypi/stats

stats is a pure-Python module providing basic statistics functions 
similar to those found on scientific calculators. It currently includes:

Univariate statistics including:
* arithmetic, harmonic, geometric and quadratic means
* median, mode
* standard deviation and variance (sample and population)

Multivariate statistics including:
* Pearson's correlation coefficient
* covariance (sample and population)
* linear regression

and others.

This is an unstable alpha release of the software. Feedback and 
contributions are welcome.



-- 
Steven D'Aprano
-- 
http://mail.python.org/mailman/listinfo/python-list