How to use lognormal distributions in Python

I’ve made an iPython Notebook that explains how to use lognormal distributions in Python/SciPy.  Python is a free and open source programming language that is becoming increasingly popular with scientists as a replacement for Matlab or IDL.  I hope that the notebook will be helpful to anyone who works with grainsize data e.g. volcanologists, sedimentologists, atmospheric scientists.  View it by clicking the picture below:

iPython Lognormal distributions notebook

iPython notebooks contain formula, code, equations and text. Click for notebook on Using the Lognormal Distribution in Python.

The page includes a button to download the notebook so that you can play around with it on your own machine.

iPython notebooks are amazing; if you use Python for science and haven’t tried them yet, then I urge you to have a look.  They let you run Python code in little chunks, displaying the results immediately and interspersed with comments and LaTeX-rendered equations.  You can also render publicly-available notebooks using the iPython Notebook Viewer website, as I have done here.  I think that they are The Future.

iPython notebooks come nicely packaged for Windows and Mac in the Anaconda Python distribution (and probably others such as Enthought, too).  You can install the ipython-notebook package on Ubuntu-like Linux distributions with a single command (sudo apt-get install ipython-notebook), but to get the most up-to-date versions it is better to use pip:

sudo apt-get install python-pip
sudo pip install ipython

# Depending on what is already installed, 
# you may also need to add some dependencies.

sudo apt-get install pandoc python-zmq python-tornado
Categories: Uncategorized

Leave a comment:

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>