Skip to content

Commit

Permalink
TST: Add test to ensure Dataframe describe does not throw an error (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyvs1 committed Dec 10, 2020
1 parent 37662ea commit d4d42ba
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pandas/tests/frame/methods/test_describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,3 298,14 @@ def test_describe_percentiles_integer_idx(self):
],
)
tm.assert_frame_equal(result, expected)

def test_describe_does_not_raise_error(self):
# GH#32409
df = DataFrame([{"test": {"a": "1"}}, {"test": {"a": "2"}}])
expected = DataFrame(
{"test": [2, 2, {"a": "1"}, 1]}, index=["count", "unique", "top", "freq"]
)
result = df.describe()
tm.assert_frame_equal(result, expected)
exp_repr = " test\n" "count 2\n" "unique 2\n" "top {'a': '1'}\n" "freq 1"
assert repr(result) == exp_repr

0 comments on commit d4d42ba

Please sign in to comment.