[IPython-dev] Integrating pandas into pylab

Satrajit Ghosh satra at mit.edu
Wed Oct 26 13:36:30 EDT 2011

hi all,

> > That said, the major problem is that the current organization of the
> > major packages is not logical or intuitive.  numpy has arrays,
> > algorithms and IO, scipy has algorithms and IO, matplotlib has
> > plotting and algorithms and IO, pandas has datastructures, IO,
> > algorithms and plotting (albeit all organized around the dataframe).
> > And so on.  I think there is room for a namespace package that
> > integrates across these and makes it more intuitive.  The proper top
> > level namespaces are something like: array (or statstructures more
> > generally), algo, plot, io.  In this model, you would pull the
> > relevant components from numpy, scipy, mpl, pandas, scikits, ETS, etc
> > into the relevant namespaces.
> I would not want to make the new namespace nested - it should be flat
> like the current pylab is.  I think the main point here is that we are
> competing with Matlab, Mathematica, etc. which all have completely
> flat namespaces.  Not that we want to copy everything these packages
> do, but for new users, non-technical folks, undergraduates the entire
> idea of namespaces is confusing.  This problem (for these users) is
> namspaces themselves, not just that the existing ones are confusing.

i don't think what confuses new users is whether the namespace is flat or
nested, but where to get the functionality that they are looking for and if
in the nested namespace there are multiple implementations of the
functionality, which one to use.

even in matlab, which has a flat namespace, users need to do 'lookfor' to
search for available functions. and in cases where additional toolboxes are
installed which may have the same function filename, it's a nightmare.

so i think the notion of namespace is crucial in the scientific computing
world and the import statement is not the biggest block that new users face.
most often, it is: 'which function solves my problem?'. for example, *once*
you know 'plot', 'hist' and 'imshow' are in pyplot, it's really trivial for
most users to type:

import matplotlib.pyplot as plt
from matplotlib.pyplot import plot, hist, imshow

i agree with john that having namespaces like:


might actually be useful in categorizing and looking for functionality,
which i believe was the one of the intents of namespaces in the first place.

if the goal is to provide matlab compatibility and assume that function
names and their calling structures are identical, then the flat namespace
helps. however, beyond some routines, this is impossible to maintain.

i think scientific computing in python would do very well if some mechanism
like 'lookfor' provided users (especially new users) a good way to find
functionality. i don't think the flat namespace solves this problem.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20111026/28979381/attachment.html>

More information about the IPython-dev mailing list