-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
TST/REF: collect DataFrame reduction tests #24914
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e8ffa81
collect and label tests
jbrockmendel f258a59
collect assert_stat_op_api tests
jbrockmendel a124390
collect tests
jbrockmendel 91088c2
put median tests together
jbrockmendel e87f5b8
Merge branch 'master' of https://github.com/pandas-dev/pandas into tana
jbrockmendel 7008ba9
typo fixup
jbrockmendel 95b2d7e
collect more, flake8 fixup
jbrockmendel eb1c1eb
typo fixup
jbrockmendel 0e9be35
Merge branch 'master' of https://github.com/pandas-dev/pandas into tana
jbrockmendel 2a2d0af
flake8 fixups
jbrockmendel e01936d
de-duplicate
jbrockmendel d646dad
Merge branch 'master' of https://github.com/pandas-dev/pandas into tana
jbrockmendel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
flake8 fixups
- Loading branch information
commit 2a2d0af48a9713c7b6c16f4430a95d801d10913c
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -718,7 +718,7 @@ def test_stat_op_api(self, float_frame, float_string_frame): | |
| assert_stat_op_api('median', float_frame, float_string_frame) | ||
|
|
||
| try: | ||
| from scipy.stats import skew, kurtosis | ||
| from scipy.stats import skew, kurtosis # noqa:F401 | ||
| assert_stat_op_api('skew', float_frame, float_string_frame) | ||
| assert_stat_op_api('kurt', float_frame, float_string_frame) | ||
| except ImportError: | ||
|
|
@@ -739,19 +739,19 @@ def var(x): | |
| return np.var(x, ddof=1) | ||
|
|
||
| def std(x): | ||
| return x: np.std(x, ddof=1) | ||
| return np.std(x, ddof=1) | ||
|
|
||
| def sem(x): | ||
| return np.std(x, ddof=1) / np.sqrt(len(x)) | ||
|
|
||
| def skew(x): | ||
| from scipy.stats import skew | ||
| def skewness(x): | ||
| from scipy.stats import skew # noqa:F811 | ||
| if len(x) < 3: | ||
| return np.nan | ||
| return skew(x, bias=False) | ||
|
|
||
| def kurt(x): | ||
| from scipy.stats import kurtosis | ||
| from scipy.stats import kurtosis # noqa:F811 | ||
| if len(x) < 4: | ||
| return np.nan | ||
| return kurtosis(x, bias=False) | ||
|
|
@@ -770,20 +770,18 @@ def kurt(x): | |
| check_dates=True) | ||
| assert_stat_op_calc('product', np.prod, float_frame_with_na) | ||
|
|
||
|
|
||
| assert_stat_op_calc('mad', mad, float_frame_with_na) | ||
| assert_stat_op_calc('var', var, float_frame_with_na) | ||
| assert_stat_op_calc('std', std, float_frame_with_na) | ||
|
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. in a future pass should parameterize this test |
||
| assert_stat_op_calc('sem', sem, float_frame_with_na) | ||
|
|
||
|
|
||
| assert_stat_op_calc('count', count, float_frame_with_na, | ||
| has_skipna=False, check_dtype=False, | ||
| check_dates=True) | ||
|
|
||
| try: | ||
| from scipy import skew, kurtosis | ||
| assert_stat_op_calc('skew', skew, float_frame_with_na) | ||
| from scipy import skew, kurtosis # noqa:F401 | ||
| assert_stat_op_calc('skew', skewness, float_frame_with_na) | ||
| assert_stat_op_calc('kurt', kurt, float_frame_with_na) | ||
| except ImportError: | ||
| pass | ||
|
|
||
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.
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.
what are all these for?
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.
These get passed to assert_stat_op_calc. In the status quo these are defined in separate test methods and are mostly named
alt