File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -245,4 +245,4 @@ Bug Fixes
245
245
246
246
- Bug in hiding ticklabels with subplots and shared axes when adding a new plot to an existing grid of axes (:issue:`9158`)
247
247
- Bug in ``transform`` and ``filter`` when grouping on a categorical variable (:issue:`9921`)
248
-
248
+ - Bug in ``transform`` when groups are equal in number and dtype to the input index (:issue:`9700`)
Original file line number Diff line number Diff line change @@ -959,6 +959,12 @@ def demean(arr):
959
959
g = df .groupby (pd .TimeGrouper ('M' ))
960
960
g .transform (lambda x : x - 1 )
961
961
962
+ # GH 9700
963
+ df = DataFrame ({'a' : range (5 , 10 ), 'b' : range (5 )})
964
+ result = df .groupby ('a' ).transform (max )
965
+ expected = DataFrame ({'b' : range (5 )})
966
+ tm .assert_frame_equal (result , expected )
967
+
962
968
def test_transform_fast (self ):
963
969
964
970
df = DataFrame ( { 'id' : np .arange ( 100000 ) / 3 ,
You can’t perform that action at this time.
0 commit comments