[Numpy-discussion] Matlab page on scipy wiki

Christopher Barker Chris.Barker at noaa.gov
Fri Feb 10 13:34:04 EST 2006

Bill Baxter wrote:
> By the way, is there any python way to tell which package a symbol is coming
> from?

Yes. Don't use "import *".

There is a long tradition of using NumPy this way:

from numpy import *

But now I always use it this way:

import numpy as N

(or nx, or whatever short name you want). I like it, because it's always 
clear where stuff is coming from. numpy's addition of a number of 
methods for what used to be functions helps make this more convenient too.

"Namespaces are one honking great idea -- let's do more of those!"

from: http://www.python.org/doc/Humor.html#zen


Christopher Barker, Ph.D.
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov

More information about the NumPy-Discussion mailing list