Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Feb 2, 2024. It is now read-only.
Scale var/std - #616
Merged
Merged
Conversation
AlexanderKalistratov
commented
Feb 17, 2020
Collaborator
You could optimize it further. The formula for variance is: So, you could implement variance as: square_sum=0.sum=0.total_count=0foriinprange(len):
a=self._data[i]
ifnotisnan(a):
square_sum+=a*asum+=atotal_count+=1iftotal_count<1:
returnnumpy.nanreturn (square_sum-sum*sum/total_count)/total_countAlso you could see covariance as an example Also, haven't validate the final formula. So there could be errors |
Add perf test for var with skipna=True Add numpy_like var Add numpy_like nanmean Add test for numpy_like.nanvar Add perf test for numpy_like.nanvar Add perf test for Series.std(skipna=True)
AlexanderKalistratov
approved these changes
Feb 19, 2020
PokhodenkoSA
commented
Feb 19, 2020
ContributorAuthor
I will implement it in separate PR. |
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 freeto 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.
Only
varis implemented yet.This PR is based on #610 because used parallel
nanmean.stdautoscaleup becauseSeries.stdis implemented viaSeries.var. @densmirn thank you :)