看板 Python 關於我們 聯絡資訊
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