This repository was archived by the owner on Feb 2, 2024. It is now read-only.
Scale Series.median(skipna=True/False)#579
Closed
PokhodenkoSA wants to merge 1 commit intoIntelPython:masterfrom
Closed
Scale Series.median(skipna=True/False)#579PokhodenkoSA wants to merge 1 commit intoIntelPython:masterfrom
PokhodenkoSA wants to merge 1 commit intoIntelPython:masterfrom
Conversation
|
|
||
| def nanmedian_impl(a): | ||
| # Create a temporary workspace with only non-NaN values | ||
| temp_arry = np.empty(a.size, a.dtype) |
Collaborator
There was a problem hiding this comment.
Result of median always should be float
| def np_nanmedian(a): | ||
| if not isinstance(a, types.Array): | ||
| return | ||
| isnan = get_isnan(a.dtype) |
Collaborator
There was a problem hiding this comment.
Looks good. Let's use it everywhere
Collaborator
There was a problem hiding this comment.
After some investigation, i see few issues with it:
- It return
Falsefor ints, but the function itself doesn't inline - Even if it would inline, there is no dead code elimination pass after inline pass. Which means, the condition would not be eliminated
- Even if dead code elimination would be added in previous versions it works only with conditions like
if True:andif False:and doesn't work with conditions likeif not False.
Probably llvm would be able to fix all this issues in it's own IR. Probably not. Need to check and measure
Still, let's stick to the strategy use this function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Bad performance.