Skip to content

Commit dd461bc

Browse files
Add test for the df.info() case (GH14298)
1 parent b351037 commit dd461bc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/frame/test_repr_info.py

+10
Original file line numberDiff line numberDiff line change
@@ -405,3 +405,13 @@ def memory_usage(f):
405405

406406
# high upper bound
407407
self.assertTrue(memory_usage(unstacked) - memory_usage(df) < 2000)
408+
409+
def test_info_categorical(self):
410+
# GH14298
411+
idx = pd.CategoricalIndex(['a', 'b'])
412+
df = pd.DataFrame(np.zeros((2, 2)), index=idx, columns=idx)
413+
414+
import sys
415+
sys.stdout = StringIO()
416+
df.info()
417+
sys.stdout = sys.__stdout__

0 commit comments

Comments
 (0)