-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
fix BUG: ValueError when performing rolling covariance on multi indexed DataFrame #16814
Changes from 5 commits
acf3754
6c9079a
e1c772e
9193406
a3a60c4
8782abb
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 |
---|---|---|
|
@@ -61,6 +61,15 @@ def f(): | |
|
||
tm.assert_raises_regex(ValueError, 'The truth value of a', f) | ||
|
||
def test_multi_index_names(self): | ||
|
||
# GH 16789 | ||
cols = pd.MultiIndex.from_product([['A', 'B'], ['C', 'D', 'E']], | ||
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. can you add a comment with the issue number 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. will do. |
||
names=['1', '2']) | ||
df = pd.DataFrame(np.ones((10, 6)), columns=cols) | ||
rolling_result = df.rolling(3).cov() | ||
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. just call this result 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. thanks. will do. |
||
assert rolling_result.index.names == [None, '1', '2'] | ||
|
||
def test_labels_dtypes(self): | ||
|
||
# GH 8456 | ||
|
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.
window_flex_binary_moment
is an internal method, so the user reading these notes doesn't need to care where exactly the bug is. Better to just say something likeThere 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.
Thanks. I'll quickly fix it now.