Skip to content

Commit

Permalink
TST: Change test_groupby_copy to apply_mutate.py (#45578)
Browse files Browse the repository at this point in the history
Pending tasks from #45509
In line with issue #44803

Change test_groupby_copy from
`pandas/tests/groupby/test_groupby.py`
to `pandas/tests/groupby/test_apply_mutate.py`
  • Loading branch information
NumberPiOso authored Jan 24, 2022
1 parent e1aed9c commit 7451de8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 14 additions & 0 deletions pandas/tests/groupby/test_apply_mutate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
import pandas._testing as tm


def test_group_by_copy():
# GH#44803
df = pd.DataFrame(
{
"name": ["Alice", "Bob", "Carl"],
"age": [20, 21, 20],
}
).set_index("name")

grp_by_same_value = df.groupby(["age"]).apply(lambda group: group)
grp_by_copy = df.groupby(["age"]).apply(lambda group: group.copy())
tm.assert_frame_equal(grp_by_same_value, grp_by_copy)


def test_mutate_groups():

# GH3380
Expand Down
14 changes: 0 additions & 14 deletions pandas/tests/groupby/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,6 @@
from pandas.core.groupby.base import maybe_normalize_deprecated_kernels


def test_group_by_copy():
# GH#44803
df = DataFrame(
{
"name": ["Alice", "Bob", "Carl"],
"age": [20, 21, 20],
}
).set_index("name")

grp_by_same_value = df.groupby(["age"]).apply(lambda group: group)
grp_by_copy = df.groupby(["age"]).apply(lambda group: group.copy())
tm.assert_frame_equal(grp_by_same_value, grp_by_copy)


def test_repr():
# GH18203
result = repr(Grouper(key="A", level="B"))
Expand Down

0 comments on commit 7451de8

Please sign in to comment.