[SciPy-user] help/import question

Pearu Peterson pearu at scipy.org
Sun Jan 8 03:36:20 CST 2006



On Fri, 6 Jan 2006, Steve Schmerler wrote:

> Hi
>
> Some things I discoverd while playing arround with the recent
> numpy/scipy svn:
>
> #################################################################################################################
>
> In [9]: ?scipy
>
> [...]
>
>     Available subpackages
>     ---------------------
>     stats       --- Statistical Functions
>     sparse      --- Sparse matrix [*]
>     lib         --- Python wrappers to external libraries
>     linalg      --- Linear algebra routines
>     signal      --- Signal Processing Tools [*]
>     misc        --- Various utilities that don't have another home.
>     interpolate --- Interpolation Tools [*]
>     optimize    --- Optimization Tools
>     cluster     --- Vector Quantization / Kmeans [*]
>     fftpack     --- Discrete Fourier Transform algorithms
>     io          --- Data input and output [*]
>     integrate   --- Integration routines [*]
>     lib.lapack  --- Wrappers to LAPACK library
>     special     --- Special Functions
>     lib.blas    --- Wrappers to BLAS library [*]
>       [*] - using a package requires explicit import
>
>
> #################################################################################################################
>
> The *-marking of subpackages tells me that I can do
>
> import scipy
> ?scipy.stats
>
> but to get help on sparse I have to
>
> import scipy.signal
> ?scipy.signal
>
> Is this desired? If so, why?

Yes. Users seldomly need to use all of scipy packages in their programs, 
so, by default, not all scipy packages are imported while importing 
scipy, this reduces import time and consumes memory.

If you wish to load all scipy packages, then do

   import scipy
   scipy.pkgload()

and then simple

   ?scipy.signal

also works.

Pearu



More information about the SciPy-user mailing list