[Numpy-discussion] Numpy-discussion Digest, Vol 19, Issue 44

Jarrod Millman millman@berkeley....
Thu Apr 10 02:55:40 CDT 2008

On Wed, Apr 9, 2008 at 11:21 PM, Joe Harrington <jh@physics.ucf.edu> wrote:
> > Absolutely.  Let's please standardize on:
>  > import numpy as np
>  > import scipy as sp
>  I hope we do NOT standardize on these abbreviations.  While a few may
>  have discussed it at a sprint, it hasn't seen broad discussion and
>  there are reasons to prefer the other practice (numpy as N, scipy as
>  S, pylab as P).  My reasons for saying this go back to my reasons for
>  disliking lots of heirarchical namespaces at all: if we must have
>  namespaces, let's minimize the visual and typing impact by making them
>  short and visually distinct from the function names (by capitalizing
>  them).

Using single capital letters was discussed and dismissed.  The
standard abbreviations should be at least two letters and they should
follow the Python naming convention for packages (i.e., all
lowercase).  The single upper case letter actually uses two keys

Following the convention used by the NumPy C-API and as suggested by
the camelcase spelling, it was agreed to abbreviate numpy as np.
After that we agreed to follow this pattern and name scipy sp.  We
also spoke with John Hunter and some of the matplotlib developers and
agreed that pylab would be abbreviated as plt.  So in summary:

import numpy as np
import scipy as sp
import pylab as plt

Why I don't want to shut anyone out of the discussion, I hope we can
just agree to use these standards.  There is quite a bit of work to do
and too few hands and too little time.


Jarrod Millman
Computational Infrastructure for Research Labs
10 Giannini Hall, UC Berkeley
phone: 510.643.4014

More information about the Numpy-discussion mailing list