-
Notifications
You must be signed in to change notification settings - Fork 93
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
Closes-4096, adding range
parameter to histogram
functions
#4078
base: master
Are you sure you want to change the base?
Conversation
d351696
to
d51dafd
Compare
@@ -1996,17 +2064,31 @@ def histogramdd( | |||
if any(b < 1 for b in bins): | |||
raise ValueError("bins must be 1 or greater") | |||
|
|||
if not range: | |||
range = [None for pda in sample] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right here you allow range to contain the value None
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I resolved this by introducing a different variable, range2
, instead of reusing range
for different things.
BTW it turns out the same trick works in the other case with xMin
et al. so I applied it there as well by introducing xMin0
et al.
arkouda/numpy/_numeric.py
Outdated
bin_boundaries = [linspace(a.min(), a.max(), b + 1) for a, b in zip(sample, bins)] | ||
bins_pda = array(bins)[::-1] | ||
dim_prod = (cumprod(bins_pda) // bins_pda)[::-1] | ||
bin_boundaries = [linspace(r[0], r[1], b + 1) for r, b in zip(range, bins)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But down here, the value None
is not indexable as r[0]
and r[1]
.
b281dc9
to
36a920c
Compare
range
parameter to histogram
functionsrange
parameter to histogram
functions
e196fc5
to
0a81945
Compare
Signed-off-by: Vassily Litvinov <[email protected]>
Signed-off-by: Vassily Litvinov <[email protected]>
Signed-off-by: Vassily Litvinov <[email protected]>
Signed-off-by: Vassily Litvinov <[email protected]>
Signed-off-by: Vassily Litvinov <[email protected]>
Signed-off-by: Vassily Litvinov <[email protected]>
Signed-off-by: Vassily Litvinov <[email protected]>
Signed-off-by: Vassily Litvinov <[email protected]>
Signed-off-by: Vassily Litvinov <[email protected]>
Signed-off-by: Vassily Litvinov <[email protected]>
Signed-off-by: Vassily Litvinov <[email protected]>
Signed-off-by: Vassily Litvinov <[email protected]>
Signed-off-by: Vassily Litvinov <[email protected]>
Signed-off-by: Vassily Litvinov <[email protected]>
d541bf8
to
8fd9a7d
Compare
Closes #4096. Required by Bears-R-Us/arkouda-contrib#179
Adds
numpy
-style optionalrange
parameter to client histogram functions:histogram()
histogram2d()
histogramdd()
Switches the histograms produced by
histogramdd()
to containfloat
counts instead of integer counts, to matchnumpy
.While there:
histogramdDMsg()
more efficient.histogramdd()
oncumprod()
./
and trailing whitespace.