File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2081,7 +2081,11 @@ def test_groupby_and_transform() -> None:
2081
2081
)
2082
2082
grouped = df .groupby ("A" )[["C" , "D" ]]
2083
2083
grouped1 = ser .groupby (ser > 100 )
2084
- c1 = grouped .transform (lambda x : (x - x .mean ()) / x .std ())
2085
- c2 = grouped1 .transform (lambda x : x .max () - x .min ())
2084
+ c1 = grouped .transform ("sum" )
2085
+ c2 = grouped .transform (lambda x : (x - x .mean ()) / x .std ())
2086
+ c3 = grouped1 .transform ("cumsum" )
2087
+ c4 = grouped1 .transform (lambda x : x .max () - x .min ())
2086
2088
check (assert_type (c1 , pd .DataFrame ), pd .DataFrame )
2087
- check (assert_type (c2 , pd .Series ), pd .Series )
2089
+ check (assert_type (c2 , pd .DataFrame ), pd .DataFrame )
2090
+ check (assert_type (c3 , pd .Series ), pd .Series )
2091
+ check (assert_type (c4 , pd .Series ), pd .Series )
You can’t perform that action at this time.
0 commit comments