Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Histogramdd breaks on big arrays in Windows #22625

Merged
merged 1 commit into from Nov 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion numpy/lib/histograms.py
Expand Up @@ -1019,7 +1019,7 @@ def histogramdd(sample, bins=10, range=None, normed=None, weights=None,
sample = np.atleast_2d(sample).T
N, D = sample.shape

nbin = np.empty(D, int)
nbin = np.empty(D, np.intp)
edges = D*[None]
dedges = D*[None]
if weights is not None:
Expand Down
11 changes: 11 additions & 0 deletions numpy/lib/tests/test_histograms.py
Expand Up @@ -6,6 +6,7 @@
assert_array_almost_equal, assert_raises, assert_allclose,
assert_array_max_ulp, assert_raises_regex, suppress_warnings,
)
from numpy.testing._private.utils import requires_memory
import pytest


Expand Down Expand Up @@ -421,6 +422,16 @@ def test_histogram_bin_edges(self):
edges = histogram_bin_edges(arr, bins='auto', range=(0, 1))
assert_array_equal(edges, e)

@requires_memory(free_bytes=1e10)
@pytest.mark.slow
def test_big_arrays(self):
sample = np.zeros([100000000, 3])
xbins = 400
ybins = 400
zbins = np.arange(16000)
hist = np.histogramdd(sample=sample, bins=(xbins, ybins, zbins))
assert_equal(type(hist), type((1, 2)))


class TestHistogramOptimBinNums:
"""
Expand Down