Add compatibility with numpy 2.0 (#1094)

Co-authored-by: Mark Towers <mark.m.towers@gmail.com>
This commit is contained in:
Ariel Kwiatkowski
2024-06-28 18:48:01 +02:00
committed by GitHub
parent 3b7f398508
commit 8161d7d0a0
26 changed files with 70 additions and 62 deletions

View File

@@ -239,7 +239,7 @@ def chi2_test(sample, low, high, bounded_below, bounded_above):
if bounded_below and bounded_above:
# X ~ U(low, high)
degrees_of_freedom = high - low + 1
degrees_of_freedom = int(high) - int(low) + 1
observed_frequency = np.bincount(sample - low, minlength=degrees_of_freedom)
assert observed_frequency.shape == (degrees_of_freedom,)
expected_frequency = np.ones(degrees_of_freedom) * n_trials / degrees_of_freedom