Skip to content

Commit 26a66c5

Browse files
authored
Merge pull request #482 from QuantEcon/sp_linalg
FIX: Import scipy.sparse.linalg
2 parents 3029221 + ac3b6ab commit 26a66c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

quantecon/markov/ddp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,8 @@ def s_wise_max(vals, out=None, out_argmax=None):
417417

418418
# Linear equation solver to be used in evaluate_policy
419419
if self._sparse:
420-
self._lineq_solve = sp.linalg.spsolve
420+
import scipy.sparse.linalg
421+
self._lineq_solve = scipy.sparse.linalg.spsolve
421422
self._I = sp.identity(self.num_states, format='csr')
422423
else:
423424
self._lineq_solve = np.linalg.solve

0 commit comments

Comments
 (0)