“问题”
scipy
公司规模相当大,成员众多。因此,为了避免运行时出现滞后
import scipy
(以及节省系统内存的使用),
松软的
the docs right here
.
您可以通过使用标准Python来解决这个明显的问题
import
语法/语义有点:
import numpy as np
A = np.random.random_sample((3, 3)) + np.identity(3)
b = np.random.rand((3))
import scipy as sp
# this won't work, raises AttributeError
# x = sp.sparse.linalg.bicgstab(A,b)
import scipy.sparse.linalg
# now that same line will work
x = sp.sparse.linalg.bicgstab(A,b)
print(x)
# output: (array([ 0.28173264, 0.13826848, -0.13044883]), 0)
基本上,如果打电话给
sp.pkg_x.func_y
AttributeError
,然后可以通过在其前面添加一行来修复它,如:
import scipy.pkg_x
scipy.pkg_x
是有效的吗
松软的
首先是子包。