-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Implement "standard error of the mean" #7133
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3794,7 +3794,8 @@ def mad(self, axis=None, skipna=None, level=None, **kwargs): | |
|
||
@Substitution(outname='variance', | ||
desc="Return unbiased variance over requested " | ||
"axis\nNormalized by N-1") | ||
"axis.\n\nNormalized by N-1 by default. " | ||
"This can be changed using the ddof argument") | ||
@Appender(_num_doc) | ||
def var(self, axis=None, skipna=None, level=None, ddof=1, **kwargs): | ||
if skipna is None: | ||
|
@@ -3811,7 +3812,8 @@ def var(self, axis=None, skipna=None, level=None, ddof=1, **kwargs): | |
|
||
@Substitution(outname='stdev', | ||
desc="Return unbiased standard deviation over requested " | ||
"axis\nNormalized by N-1") | ||
"axis.\n\nNormalized by N-1 by default. " | ||
"This can be changed using the ddof argument") | ||
@Appender(_num_doc) | ||
def std(self, axis=None, skipna=None, level=None, ddof=1, **kwargs): | ||
if skipna is None: | ||
|
@@ -3827,6 +3829,24 @@ def std(self, axis=None, skipna=None, level=None, ddof=1, **kwargs): | |
return np.sqrt(result) | ||
cls.std = std | ||
|
||
@Substitution(outname='standarderror', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't exactly sure what the rules regarding "outname" are. Can they have spaces? What about underscores? How long should they be? So this may not be the best name. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. outname is just a 'descriptive' name used to autogenerate the doc strings, so that is fine |
||
desc="Return unbiased standard error of the mean over " | ||
"requested axis.\n\nNormalized by N-1 by default. " | ||
"This can be changed using the ddof argument") | ||
@Appender(_num_doc) | ||
def sem(self, axis=None, skipna=None, level=None, ddof=1, **kwargs): | ||
if skipna is None: | ||
skipna = True | ||
if axis is None: | ||
axis = self._stat_axis_number | ||
if level is not None: | ||
return self._agg_by_level('sem', axis=axis, level=level, | ||
skipna=skipna, ddof=ddof) | ||
|
||
return self._reduce(nanops.nansem, axis=axis, skipna=skipna, | ||
ddof=ddof) | ||
cls.sem = sem | ||
|
||
@Substitution(outname='compounded', | ||
desc="Return the compound percentage of the values for " | ||
"the requested axis") | ||
|
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 add a test for this in test_resample? (not sure how much infrastructure is their for this), iow huw much is actually already tested
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.
Done