Official abbreviation for: import scipy as sp/sc

EDIT: As of version 1.9, scipy has changed so that import scipy now allows access to the modules but only actually loads them when they are used. Please refer to the answer from tupui below (and upvote that answer to make it the top one!). For historical purposes, here is my answer from 2016:

The “official” answer, according to the Scipy documentation, is that there is really no reason to ever

import scipy

since all of the interesting functions in Scipy are actually located in the submodules, which are not automatically imported. Therefore, the recommended method is to use

from scipy import fftpack
from scipy import integrate

then, functions can be called with

fftpack.fft()

Personally, I always use

import scipy.fftpack

and live with the slightly longer function call

scipy.fftpack.fft(data)

This way I know where the functions are coming from.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)