From 59b17cdeaa2f5b791c6337f21fd976c2c3de3739 Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Tue, 4 Jul 2017 16:34:12 -0400 Subject: [PATCH] BUG: rolling.cov with multi-index columns should presever the MI (#16825) xref #16814 --- doc/source/whatsnew/v0.20.3.txt | 1 + pandas/tests/indexes/test_multi.py | 9 --------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/doc/source/whatsnew/v0.20.3.txt b/doc/source/whatsnew/v0.20.3.txt index e300d252a78e8..2041455cee74f 100644 --- a/doc/source/whatsnew/v0.20.3.txt +++ b/doc/source/whatsnew/v0.20.3.txt @@ -47,6 +47,7 @@ Bug Fixes - Fixed a pytest marker failing downstream packages' tests suites (:issue:`16680`) - Bug in reindexing on an empty ``CategoricalIndex`` (:issue:`16770`) - Fixed bug where computing the rolling covariance of a MultiIndexed ``DataFrame`` improperly raised a ``ValueError`` (:issue:`16789`) +- Fixed a bug in failing to compute rolling computations of a column-MultiIndexed ``DataFrame`` (:issue:`16789`, :issue:`16825`) Conversion ^^^^^^^^^^ diff --git a/pandas/tests/indexes/test_multi.py b/pandas/tests/indexes/test_multi.py index 8e383a7c1de2f..719cd2f7e01a4 100644 --- a/pandas/tests/indexes/test_multi.py +++ b/pandas/tests/indexes/test_multi.py @@ -61,15 +61,6 @@ 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']], - names=['1', '2']) - df = pd.DataFrame(np.ones((10, 6)), columns=cols) - rolling_result = df.rolling(3).cov() - assert rolling_result.index.names == [None, '1', '2'] - def test_labels_dtypes(self): # GH 8456