Skip to content

Commit 25976e9

Browse files
committed
Replaced x.size by x.shape to make it work for n-dimensional arrays
1 parent 927e9d6 commit 25976e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ibicus/utils/_math_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def cdf(self, x: np.ndarray, *fit: tuple) -> np.ndarray:
279279
else:
280280
return np.where(
281281
x == 0,
282-
np.random.uniform(0, p0, x.size),
282+
np.random.uniform(0, p0, x.shape),
283283
p0 + (1 - p0) * self.distribution.cdf(x, *fit_rainy_days),
284284
)
285285

@@ -423,7 +423,7 @@ def cdf(self, x: np.ndarray, *fit: tuple) -> np.ndarray:
423423
"""
424424
x = np.where(
425425
x < self.censoring_threshold,
426-
np.random.uniform(0, self.censoring_threshold, x.size),
426+
np.random.uniform(0, self.censoring_threshold, x.shape),
427427
x,
428428
)
429429
return scipy.stats.gamma.cdf(x, *fit)

0 commit comments

Comments
 (0)