-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Handling NaN case before dtype conversion #40638 #41027
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
Hello @Sudomarko! 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 2021-04-19 03:59:09 UTC |
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.
Thanks for the pr @Sudomarko. First thing any pr needs is tests to make sure the changes actually work (which would catch the issues currently here).
In general, not sure why you're changing the method of filling missing values. That existing logic should be fine.
|
||
if (copy or na_value is not lib.no_default) and result is self._ndarray: | ||
if na_value is not lib.no_default: | ||
temp.fillna(method="bfill") |
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.
Why bfill? Also, this line won't have any effect anyway because inplace=False
by default.
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.
And na_value
is no longer being used to fill
@@ -355,9 +355,14 @@ def to_numpy( # type: ignore[override] | |||
copy: bool = False, | |||
na_value=lib.no_default, | |||
) -> np.ndarray: | |||
result = np.asarray(self._ndarray, dtype=dtype) | |||
temp = self |
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.
No reason for another temporary array, can just use result
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
@Sudomarko closing as stale. ping when ready to continue and i'll re-open. |
Handles the NA/NaN case before the dtype conversion