-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Nan must not be converted to string using .loc #45695
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
NumberPiOso
commented
Jan 29, 2022
- Closes NaN is converted to strings when reassigning a column with .loc #28403
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
pandas/tests/indexing/test_loc.py
Outdated
@@ -43,6 +43,15 @@ | |||
from pandas.tests.indexing.common import Base | |||
|
|||
|
|||
def test_not_change_nan_loc(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add a separate test function for the df = pd.DataFrame({'A': [np.nan, np.nan, 'b']})
case in the issue as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use pytest.mark.parameterize
to turn this into 1 test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
ci checks are failing,
Running mypy at the file confirm the error, and the CI yields an even more errors.
Should a new Issue about this be added? I would happily work on that |
Yup this is unrelated. Looks like it originated from #45792 cc @jbrockmendel |
Thanks for all your work closing these regression tests @NumberPiOso! Happy to have more! |
* TST: Nan must not be converted to string Closes pandas-dev#28403 * TST: Add test specific to the issue pandas-dev#28403 * TST: Parametrize multiple inputs change nan loc
* TST: Nan must not be converted to string Closes pandas-dev#28403 * TST: Add test specific to the issue pandas-dev#28403 * TST: Parametrize multiple inputs change nan loc