Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/source/whatsnew/v0.15.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ Experimental

Bug Fixes
~~~~~~~~~

- Bug in ``cut``/``qcut`` when using ``Series`` and ``retbins=True`` (:issue:`8589`)

- Fix ``shape`` attribute for ``MultiIndex`` (:issue:`8609`)
2 changes: 1 addition & 1 deletion pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def transpose(self):
@property
def shape(self):
""" return a tuple of the shape of the underlying data """
return self._data.shape
return self.values.shape

@property
def ndim(self):
Expand Down
11 changes: 11 additions & 0 deletions pandas/tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ def f():
pass
tm.assertRaisesRegexp(ValueError,'The truth value of a',f)

def test_ndarray_compat_properties(self):

idx = self.create_index()
self.assertTrue(idx.T.equals(idx))
self.assertTrue(idx.transpose().equals(idx))

values = idx.values
for prop in ['shape', 'ndim', 'size', 'itemsize', 'nbytes']:
self.assertEqual(getattr(idx, prop), getattr(values, prop))


class TestIndex(Base, tm.TestCase):
_holder = Index
_multiprocess_can_split_ = True
Expand Down