Matplotlib 稀疏矩阵pylab的逆问题
我试着做到以下几点Matplotlib 稀疏矩阵pylab的逆问题,matplotlib,scipy,Matplotlib,Scipy,我试着做到以下几点 from scipy import * from numpy import * import scipy as s import numpy as np import math import scipy.sparse as l from plot import Graph3DSolution import numpy.linalg as lin currentSol=s.sparse.linalg.inv(I-C)*A*lastSol 我遗漏了一些代码,但问题是 Trac
from scipy import *
from numpy import *
import scipy as s
import numpy as np
import math
import scipy.sparse as l
from plot import Graph3DSolution
import numpy.linalg as lin
currentSol=s.sparse.linalg.inv(I-C)*A*lastSol
我遗漏了一些代码,但问题是
Traceback (most recent call last):
File "explict1wave.py", line 62, in <module>
currentSol=s.sparse.linalg.inv(I-C)*A*lastSol
AttributeError: 'module' object has no attribute 'linalg'
Python 2.7.6 |Anaconda 1.9.1 (x86_64)| (default, Jan 10 2014, 11:23:15)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
im>>> import scipy
>>> scipy.__version__
'0.14.0'
>>>
回溯(最近一次呼叫最后一次):
文件“explict1wave.py”,第62行,在
currentSol=s.sparse.linalg.inv(I-C)*A*lastSol
AttributeError:“模块”对象没有属性“linalg”
Python 2.7.6 | Anaconda 1.9.1(x86_64)|(默认,2014年1月10日,11:23:15)
[GCC 4.0.1(苹果公司5493版)]关于达尔文
有关详细信息,请键入“帮助”、“版权”、“信用证”或“许可证”。
im>>>导入scipy
>>>scipy.\u版本__
'0.14.0'
>>>
我查阅了文档,这些库似乎从12年就存在了。我不知道问题是什么,但我肯定这很简单,我没有看到 >>将scipy作为s导入
>>> import scipy as s
>>> s.sparse
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'sparse'
>>>
>>> from scipy.sparse import linalg
>>> linalg.inv
<function inv at 0x19b1758>
>>>
>>>美国稀疏
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
AttributeError:“模块”对象没有属性“稀疏”
>>>
>>>从scipy.sparse导入linalg
>>>李纳格投资公司
>>>
将军
另一方面,最好避免星型导入。scipy import*中的、numpy import*
中的不建议使用,此处也不需要。与导入scipy作为s相同