-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: Series[timdelta64].var() should _not_ work #28289
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 all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
704b422
remove IX
jbrockmendel ec02d1f
remove ix-only methods
jbrockmendel db1567f
lint fixups
jbrockmendel c8ff4a0
Merge branch 'master' of https://github.com/pandas-dev/pandas into rmix
jbrockmendel 2c8ef9a
Merge branch 'master' of https://github.com/pandas-dev/pandas into rmix
jbrockmendel 1ed8a96
Merge branch 'master' of https://github.com/pandas-dev/pandas into rmix
jbrockmendel 8abdbaf
Merge branch 'master' of https://github.com/pandas-dev/pandas into rmix
jbrockmendel 23d2eca
restore getitem needed by geopandas
jbrockmendel ecc8b36
remove xfail
jbrockmendel 9f78ec7
Merge branch 'master' of https://github.com/pandas-dev/pandas into rmix
jbrockmendel 3ca8c86
Merge branch 'master' of https://github.com/pandas-dev/pandas into rmix
jbrockmendel 812b5fb
Merge branch 'master' of https://github.com/pandas-dev/pandas into rmix
jbrockmendel 2e09bd6
Merge branch 'master' of https://github.com/pandas-dev/pandas into rmix
jbrockmendel 966f749
restore and update tests per comments
jbrockmendel 18033b4
remove test_ix
jbrockmendel b9f61cb
Merge branch 'master' of https://github.com/pandas-dev/pandas into rmix
jbrockmendel c319080
Merge branch 'master' of https://github.com/pandas-dev/pandas into rmix
jbrockmendel e467976
Merge branch 'master' of https://github.com/pandas-dev/pandas into rmix
jbrockmendel cb7ef3b
remove ix benchmarks
jbrockmendel 52f4ff1
Merge branch 'master' of https://github.com/pandas-dev/pandas into rmix
jbrockmendel 61feeeb
BUG: fix+test Series[timedelta64].var
jbrockmendel db73405
fix+test dataframe var with td64
jbrockmendel 010e2ef
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel 04a546a
add mask support
jbrockmendel 27fea95
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel fb0374f
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel 9e401dd
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel 965f0a7
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel fa1eb8c
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel 58801d3
revert changes that got in via stash pop i think
jbrockmendel 59b83e1
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel 6687b69
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel d258e83
whatsnew
jbrockmendel 5bd457d
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel f827fb0
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel 619c394
remove no-longer-necessary check
jbrockmendel d37fcb3
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel c753617
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel 66bc863
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel 02a566b
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel 4d3d8ec
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel 94023db
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel 317bd2a
Merge branch 'master' of https://github.com/pandas-dev/pandas into tdvar
jbrockmendel 9598c2f
CLN: use _get_values
jbrockmendel a6c6b87
blackify
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
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
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
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
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 |
---|---|---|
|
@@ -300,11 +300,14 @@ def test_timedelta_ops(self): | |
assert result[0] == expected | ||
|
||
# invalid ops | ||
for op in ["skew", "kurt", "sem", "prod"]: | ||
for op in ["skew", "kurt", "sem", "prod", "var"]: | ||
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. let's split this to a separate test that is paramterized (followon) |
||
msg = "reduction operation '{}' not allowed for this dtype" | ||
with pytest.raises(TypeError, match=msg.format(op)): | ||
getattr(td, op)() | ||
|
||
with pytest.raises(TypeError, match=msg.format(op)): | ||
getattr(td.to_frame(), op)(numeric_only=False) | ||
|
||
# GH#10040 | ||
# make sure NaT is properly handled by median() | ||
s = Series([Timestamp("2015-02-03"), Timestamp("2015-02-07")]) | ||
|
@@ -636,8 +639,13 @@ def test_ops_consistency_on_empty(self, method): | |
assert pd.isna(result) | ||
|
||
# timedelta64[ns] | ||
result = getattr(Series(dtype="m8[ns]"), method)() | ||
assert result is pd.NaT | ||
tdser = Series([], dtype="m8[ns]") | ||
if method == "var": | ||
with pytest.raises(TypeError, match="operation 'var' not allowed"): | ||
getattr(tdser, method)() | ||
else: | ||
result = getattr(tdser, method)() | ||
assert result is pd.NaT | ||
|
||
def test_nansum_buglet(self): | ||
ser = Series([1.0, np.nan], index=[0, 1]) | ||
|
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.
Uh oh!
There was an error while loading. Please reload this page.