Use scipy.special not scipy.misc
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Tue, 4 Feb 2020 00:34:03 +0000 (00:34 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Tue, 4 Feb 2020 00:34:03 +0000 (00:34 +0000)
factorial, comb and logsumexp have been moved: trying to import them
from the old location is an error in scipy 1.3+.
https://ci.debian.net/data/autopkgtest/unstable/amd64/s/statsmodels/2949940/log.gz

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: accepted https://github.com/statsmodels/statsmodels/pull/6164

Gbp-Pq: Name scipy13_compat.patch

examples/python/discrete_choice_example.py
statsmodels/distributions/edgeworth.py
statsmodels/sandbox/infotheo.py

index 1aff497bc3e53c0b5e60159c60d7205a8676e32a..97c7955b0cfe93ea8a650f7838069a51f38e5a75 100644 (file)
@@ -126,7 +126,7 @@ formula += '+ PCTYRRND + PERMINTE*AVYRSEXP*AVSALK + PERSPENK*PTRATIO*PCTAF'
 
 stats.binom(5, 1. / 6).pmf(2)
 
-from scipy.misc import comb
+from scipy.special import comb
 comb(5, 2) * (1 / 6.)**2 * (5 / 6.)**3
 
 from statsmodels.formula.api import glm
index 4eb039138a878195dc12e65390a497db00444a98..42b18a9d073e06e79de7da5266e38cc2549f7645 100644 (file)
@@ -124,7 +124,7 @@ class ExpandedNormal(rv_continuous):
 
     >>> import matplotlib.pyplot as plt
     >>> from scipy import stats
-    >>> from scipy.misc import factorial
+    >>> from scipy.special import factorial
     >>> df = 12
     >>> chi2_c = [2**(j-1) * factorial(j-1) * df for j in range(1, 5)]
     >>> edgw_chi2 = ExpandedNormal(chi2_c, name='edgw_chi2', momtype=0)
index 7fbec50d3b83d27b71a516d92ad96a2b9d616519..6af5775b495f637e0f327cef59e2d3806e992b9c 100644 (file)
@@ -36,7 +36,7 @@ from statsmodels.compat.python import range, lzip, lmap
 from scipy import stats
 import numpy as np
 from matplotlib import pyplot as plt
-from scipy.misc import logsumexp as sp_logsumexp
+from statsmodels.compat.scipy import logsumexp as sp_logsumexp
 
 #TODO: change these to use maxentutils so that over/underflow is handled
 #with the logsumexp.