I am using scipy and numpy through Anaconda 2.1.0 distribution. I use Spyder as my Python IDE.
When I run import scipy as sp
, I can't access the subpackages, such as optimize, linalg, cluster etc. through sp.
However, when I run import numpy as np
, I am able to access all its subpackages, such as linalg, random, matrixlib, polynomial, testing, etc. through np
.
Is there a reason why the two imports work in different ways? Why does import scipy as sp
not grab all scipy subpackages into sp
's namespace?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…