mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-28 01:07:11 +00:00
Add compatibility with numpy 2.0 (#1094)
Co-authored-by: Mark Towers <mark.m.towers@gmail.com>
This commit is contained in:
committed by
GitHub
parent
3b7f398508
commit
8161d7d0a0
@@ -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
|
||||
|
Reference in New Issue
Block a user