Skip to content

Commit

Permalink
Merge pull request #9362 from glyg/master
Browse files Browse the repository at this point in the history
TST add a test for repeat() method with MultiIndex, referenced in #9361
  • Loading branch information
jreback committed Jan 27, 2015
2 parents 224a66d + 96c8084 commit 576818f
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 @@ -2261,6 +2261,15 @@ def test_set_index_period(self):
self.assertTrue(df.index.get_level_values(1).equals(idx2))
self.assertTrue(df.index.get_level_values(2).equals(idx3))

def test_repeat(self):
# GH 9361
# fixed by # GH 7891
m_idx = pd.MultiIndex.from_tuples([(1, 2), (3, 4),
(5, 6), (7, 8)])
data = ['a', 'b', 'c', 'd']
m_df = pd.Series(data, index=m_idx)
assert m_df.repeat(3).shape == (3 * len(data),)


if __name__ == '__main__':

Expand Down

0 comments on commit 576818f

Please sign in to comment.