[SciPy-user] import speed in a script

Steve Schmerler elcorto at gmx.net
Tue Oct 10 10:56:14 CDT 2006


This may be a dumb and/or more general Python question, but:

What is more advisable in terms of speed:
Say I call a script many times and inside I do nothing but

from numpy import <name>


import numpy as nu

I tried both and found no speed difference (e.g. calling the script 500 
times). I just wondered about this since there is scipy.pkgload(). In an 
interactive session "import scipy" doesn't import the whole scipy with 
all packages. Is this also true for an import statement in a script?


Random number generation is the art of producing pure gibberish as 
quickly as possible.

More information about the SciPy-user mailing list