Skip to content

TST: add test_ffill_with_string_column #40557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 13, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up result assignment
  • Loading branch information
shiv-io committed May 9, 2021
commit c4902e6911464490c57d3f2463dd2f547536d1ac
8 changes: 3 additions & 5 deletions pandas/tests/groupby/test_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ def test_ffill_missing_arguments():
@pytest.mark.parametrize("method", ["ffill", "bfill"])
def test_fillna_with_string_dtype(method):
# GH 40250
result = (
DataFrame({"a": pd.array([None, "a", None], dtype="string"), "b": [0, 0, 0]})
.groupby("b")
.fillna(method=method)
)
df = DataFrame({"a": pd.array([None, "a", None], dtype="string"), "b": [0, 0, 0]})
grp = df.groupby("b")
result = grp.fillna(method=method)
if method == "ffill":
expected = DataFrame({"a": pd.array([None, "a", "a"], dtype="string")})
elif method == "bfill":
Expand Down