Skip to content

Commit

Permalink
TST: add test for groupby on list of empty list (#25589)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins authored and TomAugspurger committed Mar 7, 2019
1 parent e6670da commit 5c159d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pandas/tests/groupby/test_groupby.py
Expand Up @@ -1714,3 +1714,12 @@ def test_groupby_multiindex_nat():
result = ser.groupby(level=1).mean()
expected = pd.Series([3., 2.5], index=["a", "b"])
assert_series_equal(result, expected)


def test_groupby_empty_list_raises():
# GH 5289
values = zip(range(10), range(10))
df = DataFrame(values, columns=['apple', 'b'])
msg = "Grouper and axis must be same length"
with pytest.raises(ValueError, match=msg):
df.groupby([[]])

0 comments on commit 5c159d2

Please sign in to comment.