-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
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
Changes from 4 commits
6c4ec55
e96d0d4
e633c2a
c723e8c
c4902e6
31c9312
4e23007
ca4acb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,21 @@ def test_ffill_missing_arguments(): | |
df.groupby("b").fillna() | ||
|
||
|
||
@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) | ||
) | ||
if method == "ffill": | ||
expected = DataFrame({"a": pd.array([None, "a", "a"], dtype="string")}) | ||
elif method == "bfill": | ||
expected = DataFrame({"a": pd.array(["a", "a", None], dtype="string")}) | ||
shiv-io marked this conversation as resolved.
Show resolved
Hide resolved
|
||
tm.assert_frame_equal(result, expected) | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we may have a similar example with object dtype, if you can co-locate, alternatively can parameterize on the dtype as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. after #41343 is merged, can use the |
||
def test_fill_consistency(): | ||
|
||
# GH9221 | ||
|
Uh oh!
There was an error while loading. Please reload this page.