Skip to content

Commit 59b17cd

Browse files
jrebackri938
authored andcommitted
BUG: rolling.cov with multi-index columns should presever the MI (#16825)
xref #16814
1 parent 5362447 commit 59b17cd

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

doc/source/whatsnew/v0.20.3.txt

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Bug Fixes
4747
- Fixed a pytest marker failing downstream packages' tests suites (:issue:`16680`)
4848
- Bug in reindexing on an empty ``CategoricalIndex`` (:issue:`16770`)
4949
- Fixed bug where computing the rolling covariance of a MultiIndexed ``DataFrame`` improperly raised a ``ValueError`` (:issue:`16789`)
50+
- Fixed a bug in failing to compute rolling computations of a column-MultiIndexed ``DataFrame`` (:issue:`16789`, :issue:`16825`)
5051

5152
Conversion
5253
^^^^^^^^^^

pandas/tests/indexes/test_multi.py

-9
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,6 @@ def f():
6161

6262
tm.assert_raises_regex(ValueError, 'The truth value of a', f)
6363

64-
def test_multi_index_names(self):
65-
66-
# GH 16789
67-
cols = pd.MultiIndex.from_product([['A', 'B'], ['C', 'D', 'E']],
68-
names=['1', '2'])
69-
df = pd.DataFrame(np.ones((10, 6)), columns=cols)
70-
rolling_result = df.rolling(3).cov()
71-
assert rolling_result.index.names == [None, '1', '2']
72-
7364
def test_labels_dtypes(self):
7465

7566
# GH 8456

0 commit comments

Comments
 (0)