Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Weighted quantile #6059
Weighted quantile #6059
Changes from 4 commits
dcd1b24
875f766
217d2f0
278bed9
80ae229
77bb84e
58af567
15e3834
83e4210
2237399
b936e21
c94fa16
ab810d7
7bcf09e
8427637
3217962
7379d22
c8871d1
b26a5fc
42ebcc2
5aa22a4
abe253e
82147aa
784cedd
3ee62fd
4d6a4fd
9f93f55
8132320
4d7f5f5
c268ddd
db706aa
33ee96c
2ffd3d3
9806db8
15ee999
9559c87
73dde79
59714af
585b705
7443b82
42a6a49
2e0c16e
4186a24
1be1f92
5c251e0
9060f8e
c112d2c
d4ba8ee
fd0a54e
8bd83f9
343b47e
c298bd0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can you do this check outside of
_weighted_quantile_type7_1d
? Also you should not useassert
(outside of tests) butThere 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.
You can get rid of this for loop if you set
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.
Careful - this uses the built-in
sum
which is much slower than(a * w).sum()
ornp.sum(a * w)
. (use(a * w).sum(axis=1)
when you get rid of the for loop).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.
Why don't you use
join="inner",
here and get rid of thealign
call?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.
Indeed, this seems to work.
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.
You could call
squeeze
unconditionally.