Skip to content

Commit 4c66d90

Browse files
committed
TST: Add test to ensure Dataframe describe does not throw an error (pandas-dev#32409)
1 parent ff628b1 commit 4c66d90

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/tests/frame/methods/test_describe.py

+11
Original file line numberDiff line numberDiff line change
@@ -376,3 +376,14 @@ def test_describe_when_include_all_exclude_not_allowed(self, exclude):
376376
msg = "exclude must be None when include is 'all'"
377377
with pytest.raises(ValueError, match=msg):
378378
df.describe(include="all", exclude=exclude)
379+
380+
def test_describe_does_not_raise_error(self):
381+
# GH#32409
382+
df = DataFrame([{"test": {"a": "1"}}, {"test": {"a": "2"}}])
383+
expected = DataFrame(
384+
{"test": [2, 2, {"a": "1"}, 1]}, index=["count", "unique", "top", "freq"]
385+
)
386+
result = df.describe()
387+
tm.assert_frame_equal(result, expected)
388+
exp_repr = " test\n" "count 2\n" "unique 2\n" "top {'a': '1'}\n" "freq 1"
389+
assert repr(result) == exp_repr

0 commit comments

Comments
 (0)