[IPython-dev] Integrating pandas into pylab

Brian Granger ellisonbg at gmail.com
Tue Oct 25 21:53:18 EDT 2011

One on hand, one of Python's core philosophies is that namespaces are
great things and that we should use more of them.

One the other hand, there is no doubt that for new users, the numpy,
scipy and matplotlib namespaces are a bit overwhelming.  I was talking
to a faculty member in the physics department just today.  I got him
running the IPython notebook and he loves it.  He has used Python
before, but he remarked how horribly confusing it is to try and figure
out where something is located in the numpy/scipy/matplotlib
hierarchies.  The somewhat fuzzy line between numpy and scipy doesn't
help and the existing pylab namespace in matplotlib partially helps,
but partially hurts as it is by no means complete.

Thinking off the top of my head...

* pylab should be a standalone project.that serves as a top-level
namespace for numpy/scipy/matplotlib.
* It should be removed from matplotlib.
* The --pylab flag in IPython should do a "from pylab import *"
* The community should create documentation for pylab that should i)
be in addition to the existing documentation ii) focused on new users
and iii) refer to the existing docs for further details.  The last
thing we want is for users to have to try to figure out that
pylab.ndarray is actually numpy.ndarray and then look the docs up for
* The documentation should be created in a manner that will allow us
to create IPython notebooks for each function/class that documents its
usage and shows examples.  With the upcoming ReST cells in the IPython
notebook this should not be difficult.
* IPython should have an integrated, pretty and searchable way for
users to browse the pylab documentation.  Mathematica's documentation
is a worthy target in this respect.
* The pylab namespace should be big.  It should include basically
everything you get in Mathematica or Matlab.  The only thing we would
have trouble including would be sympy, as it defines symbolic versions
of many of the functions in numpy.  I don't see a way around that
unless we wrote functions that were smart that could call numpy or
sympy's version by inspecting their inputs.  But sympy is a very large
project so I would probably vote to keep sympy out of the pylab
namespace and have pylab focus on numerical rather than symbolic
* At least starting out, pylab should focus only on
numpy/scipy/matplotlib and over time should only include tools that
are used community wide and recognized as "standard"  While I love
Pandas, I don't think it has risen to that level yet.
* I think IPython would be a fantastic place to host this.

Ready, set, go...



On Tue, Oct 25, 2011 at 5:38 PM, Thomas Kluyver <takowl at gmail.com> wrote:
> I don't know if this is the right forum for this, but to kick off some
> discussion:
> I see Pylab as a unfied interface for scientific programming in Python (as
> in http://www.scipy.org/PyLab), not just as a matplotlib API. I think Wes'
> pandas package is becoming indispensable for this sort of thing  - in
> particular the DataFrame class. I won't belabour its advantages, but I
> believe it's the best way to handle data in a 'table' form, which is
> ubiquitous in my field. So I'd like to see it integrated into (broad sense)
> Pylab - in particular, I think the names read_csv, read_table and DataFrame
> should be available without another import. Another possible target is the
> related scikits.statsmodels package
> (http://pypi.python.org/pypi/scikits.statsmodels/), but I'm less familiar
> with that.
> I think there's also some broader questions - pylab is a submodule of
> matplotlib, a command line flag for IPython, an idea on the scipy wiki, and
> a seemingly unmaintained "place to release Python tools" on Sourceforge. Who
> should actually be in the driving seat? Do we need a new name for the Pylab
> I'm talking about, just to avoid confusion? I've also heard people talk
> about the 'SciPy stack', although that name seems a bit odd, as I have
> little need for the scipy package itself.
> Thanks,
> Thomas
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu and ellisonbg at gmail.com

More information about the IPython-dev mailing list