Skip to content

Commit a73f975

Browse files
authored
Merge pull request statsmodels#8823 from josef-pkt/deprecations_np_pd
Maint: remove deprecated np.alltrue and np.product
2 parents 70c1a2b + e860b1b commit a73f975

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

statsmodels/distributions/bernstein.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __init__(self, cdf_grid):
4040
self.cdf_grid = cdf_grid = np.asarray(cdf_grid)
4141
self.k_dim = cdf_grid.ndim
4242
self.k_grid = cdf_grid.shape
43-
self.k_grid_product = np.product([i-1 for i in self.k_grid])
43+
self.k_grid_product = np.prod([i-1 for i in self.k_grid])
4444
self._grid = _Grid(self.k_grid)
4545

4646
@classmethod

statsmodels/distributions/copula/archimedean.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def psi_d(*args):
154154

155155
psi = self.transform.evaluate(u, *args).sum(axis)
156156

157-
pdfv = np.product(phi_d1(u, *args), axis)
157+
pdfv = np.prod(phi_d1(u, *args), axis)
158158
pdfv *= (psi_d(psi, *args))
159159

160160
# use abs, I'm not sure yet about where to add signs

statsmodels/distributions/tests/test_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def test_bernstein_2d():
148148
x2d /= x2d.max(0)
149149

150150
res_bp = evalbp(x2d, cd2d)
151-
assert_allclose(res_bp, np.product(x2d, axis=1), atol=1e-12)
151+
assert_allclose(res_bp, np.prod(x2d, axis=1), atol=1e-12)
152152

153153
# check univariate margins
154154
x2d = np.column_stack((np.arange(k_x) / (k_x - 1), np.ones(k_x)))

statsmodels/distributions/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(self, k_grid, eps=0):
4848
x_marginal = [np.arange(ki) / (ki - 1) for ki in k_grid]
4949

5050
idx_flat = np.column_stack(
51-
np.unravel_index(np.arange(np.product(k_grid)), k_grid)
51+
np.unravel_index(np.arange(np.prod(k_grid)), k_grid)
5252
).astype(float)
5353
x_flat = idx_flat / idx_flat.max(0)
5454
if eps != 0:

statsmodels/robust/scale.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,10 @@ def _estimate_both(self, a, scale, mu, axis, est_mu, n):
297297
nscale = np.sqrt(scale_num / scale_denom)
298298
nscale = tools.unsqueeze(nscale, axis, a.shape)
299299

300-
test1 = np.alltrue(
300+
test1 = np.all(
301301
np.less_equal(np.abs(scale - nscale), nscale * self.tol)
302302
)
303-
test2 = np.alltrue(
303+
test2 = np.all(
304304
np.less_equal(np.abs(mu - nmu), nscale * self.tol)
305305
)
306306
if not (test1 and test2):

0 commit comments

Comments
 (0)