Skip to content

test case for transform with fillna #27905 #27974

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

Conversation

ukantesaria
Copy link

@ukantesaria ukantesaria commented Aug 17, 2019

@pep8speaks
Copy link

pep8speaks commented Aug 17, 2019

Hello @ukantesaria! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-08-18 00:05:50 UTC



@pytest.mark.parametrize(
"inputDF, expectedDF",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inputDF -> input_df
expectedDF -> expected_df

are there other dtypes we should be testing?

@charlesdong1991
Copy link
Member

thanks for creating the PR, i think it would be nice also to test groupby(group_col).transform("fillna") case

@jreback
Copy link
Contributor

jreback commented Sep 8, 2019

can you merge master and update to comments

@jreback jreback added Groupby Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Testing pandas testing functions or related to the test suite labels Sep 8, 2019
@jreback
Copy link
Contributor

jreback commented Oct 3, 2019

can you merge master and update

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you parameterize this over all of the functions in the OP

)
def test_groupby_transform_fillna(inputDF, expectedDF):
# GH 27905 - Test fillna in groupby.transform
input1 = inputDF.groupby("A").transform(lambda x: x.fillna(x.mean()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the forms

result =
tm.assert_frame_equal(result, expected)

@jreback
Copy link
Contributor

jreback commented Oct 18, 2019

can you merge master and update to the comments

@WillAyd
Copy link
Member

WillAyd commented Oct 22, 2019

closing as stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Groupby Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Functions allowed in DataFrameGroupby.transform are not all tested
6 participants