1. Does Python have some built in statistical functions - eg. like PERCENTILE, Root Mean Square etc ?

I tried Python help and the web, to no avail. I checked standard Python maths functions and could not find anything too.

If there is nothing built in then is there a library out there to 'import' ?

2. How to list all Pythoon blocks / functions currently being installed on a system ? So that I can quickly see what is available for use


Recommended Answers

All 9 Replies

1/ if you type "statistics module python" in a google search engine, you'll find easily some modules with functions for statistics, so don't say you've searched the web !
2/ The list of all modules which come by default with the python distribution can be browsed in the documentation here http://docs.python.org/modindex.html . Other modules installed on your system should be in a folder called "site-packages" in your python library. Of course, you may have installed python modules elsewhere on your system. Run python like this

>>> import sys
>>> print sys.path
['', '/usr/lib/python2.5/site-packages/Pygments-0.8.1-py2.5.egg', '/home/eric/pymods', '/usr/lib/ooo-2.2/program', '/usr/lib/python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/Numeric', '/usr/lib/python2.5/site-packages/PIL', '/usr/lib/python2.5/site-packages/gst-0.10', '/usr/lib/python2.5/site-packages/gtk-2.0', '/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode']

The result is a list of folders where python looks for modules when you 'import' something. So you could look in these folders if you see some other modules installed (the list will be different on your system of course) !

Member Avatar

Have you considered the scipy package? It contain loads of statistical function, which operate on numpy arrays. You can easily convert any numeric list into a numpy array.

Simply use this:

# list all the modules Python currently knows about ...

I tried this, with strange results. It looks like python tries to load modules...

hangs up on bad or modified modules or mixed versions, but lets you know!
Works well on virgin installations.

I have so many modules installed and screw around with them all the time. So I use help("modules") to flush out the bad stuff.

thanks for modules lists. I still do not know how to get to statistics functions.

On http://docs.python.org/modindex.html I do no see anything for statistics

Web search with "statistics module python":
- http://starship.python.net/crew/hinsen/scientific.html - link is dead
- http://cvs.sourceforge.net/viewcvs.py/*checkout*/python/python/nondist/sandbox/statistics/statistics.py - link is dead

What I need is a ready to use module(s) from which I can call a function I need and that's it - just like with other modules.
May be I am not as good at web search as others, if you are and are willing to help then please send me a link etc.

For future reference, it seems that matplotlib at sourceforge.net (matplotlib.sourceforge.net) would be one solution to statistical calcs like percentile and root mean square, in addition to checking the scipy programs.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.