Skip to content

Commit e8530df

Browse files
committed
TST another groupby as_index test
1 parent 824e9dd commit e8530df

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/tests/test_groupby.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,10 @@ def test_groupby_as_index_apply(self):
12021202
res_not_as = g_not_as.apply(lambda x: x.head(2)).index
12031203
assert_index_equal(res_not_as, exp_not_as)
12041204

1205+
ind = Index(list('abcde'))
1206+
df = DataFrame([[1, 2], [2, 3], [1, 4], [1, 5], [2, 6]], index=ind)
1207+
res = df.groupby(0, as_index=False).apply(lambda x: x).index
1208+
assert_index_equal(res, ind)
12051209

12061210
def test_groupby_multiple_key(self):
12071211
df = tm.makeTimeDataFrame()

0 commit comments

Comments
 (0)