10000 No need to search for range if bins is iterable by orena1 · Pull Request #8984 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

No need to search for range if bins is iterable #8984

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

Closed
wants to merge 1 commit into from
Closed

No need to search for range if bins is iterable #8984

wants to merge 1 commit into from

Conversation

orena1
Copy link
Contributor
@orena1 orena1 commented Apr 24, 2017

Not searching for range will make histogram function faster.

Not searching for range will make histogram faster.
< 8000 /div>
@eric-wieser
Copy link
Member

In case you missed it, the tests failed with:

======================================================================
ERROR: Straightforward testing with a mixture of linspace data (for
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/numpy/numpy/builds/venv/lib/python2.7/site-packages/numpy/lib/tests/test_function_base.py", line 1894, in test_simple_range
    a, b = np.histogram(x, estimator, range = (-20, 20))
  File "/home/travis/build/numpy/numpy/builds/venv/lib/python2.7/site-packages/numpy/lib/function_base.py", line 688, in histogram
    keep = (a >= mn)
UnboundLocalError: local variable 'mn' referenced before assignment
======================================================================
ERROR: Smaller datasets have the potential to cause issues with the data
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/numpy/numpy/builds/venv/lib/python2.7/site-packages/numpy/lib/tests/test_function_base.py", line 1822, in test_small
    a, b = np.histogram(testdat, estimator)
  File "/home/travis/build/numpy/numpy/builds/venv/lib/python2.7/site-packages/numpy/lib/function_base.py", line 732, in histogram
    norm = bins / (mx - mn)
UnboundLocalError: local variable 'mx' referenced before assignment

With a bunch of repeats of the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0