Skip to content

Commit d695875

Browse files
committed
added the tests with a string for transform
1 parent f4b8047 commit d695875

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/test_frame.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,7 +2081,11 @@ def test_groupby_and_transform() -> None:
20812081
)
20822082
grouped = df.groupby("A")[["C", "D"]]
20832083
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())
20862088
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)

0 commit comments

Comments
 (0)