Skip to content

Commit

Permalink
TST: new test for subset of a MultiIndex dtype (#29356)
Browse files Browse the repository at this point in the history
  • Loading branch information
ganevgv authored and jreback committed Nov 16, 2019
1 parent a9abadc commit 94412ee
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pandas/tests/test_multilevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1989,6 +1989,15 @@ def test_repeat(self):
m_df = Series(data, index=m_idx)
assert m_df.repeat(3).shape == (3 * len(data),)

def test_subsets_multiindex_dtype(self):
# GH 20757
data = [["x", 1]]
columns = [("a", "b", np.nan), ("a", "c", 0.0)]
df = DataFrame(data, columns=pd.MultiIndex.from_tuples(columns))
expected = df.dtypes.a.b
result = df.a.b.dtypes
tm.assert_series_equal(result, expected)


class TestSorted(Base):
""" everything you wanted to test about sorting """
Expand Down

0 comments on commit 94412ee

Please sign in to comment.