作者jigfopsda (jigfopsda)
看板Python
標題[問題] scipy spdiags
時間Sun Oct 23 22:22:07 2011
http://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.spdiags.html
我照這網站上的範例打結果出現錯誤@@
>>> from scipy import *
>>> data = array([[1,2,3,4],[1,2,3,4],[1,2,3,4]])
>>> diags = array([0,-1,2])
>>> spdiags(data, diags, 4, 4).todense()
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
spdiags(data, diags, 4, 4).todense()
NameError: name 'spdiags' is not defined
有import了應該是不會發生這種事情吧(?)
請問可能會是什麼問題呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.73.242.151
→ suzuke:from scipy import sparse 10/23 23:51
→ suzuke:sparse.spdiags 10/23 23:52