-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG : Allow axis = 'columns' with limit and no method to work on fillna. #42856
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
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c5a545f
solves issue #40989 by raising NotImplementedError and modifying docs
GYvan bda00fe
Testing the NotImplementedError created to solve issue #40989
GYvan 4cba8ca
pre-commit error fixed
GYvan 44af021
added modified generic.py
GYvan 3043fdb
added modified test_fillna.py
GYvan 9183503
reverted changes for test_frame.py
GYvan ceef973
added another test
GYvan 49bdfed
added into bug fixes in whatsnew
GYvan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
isn't this the same as L6254
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, the code is somehow the same, with minor adjustments. I basically used it to make transposes as the ones done when the method is not
None
. This is because when the method is valid, bothaxis = 1
andaxis = 0
works correctly with the given limit forFillna
due to the transposition at L6254. Therefore, I tried to do the same kind of transposing so thataxis = 1
andaxis = 0
would work accordingly for the given value and limit.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.
ok any possibiltiy of combing those cases into a similar code block?
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.
Hi @jreback I tried to combine these cases into a similar code block and this is the code that I came up with for a separate top-level
if-else
block infillna
:I also added the condition for
x==0
for the remaining of theelif not is_list_like(value)
so that it won't interfere with the above changes withx == 1
.However, due to the additional code block: the code structure is slightly modified because before, the code for
fillna
was clearly split between the case for whenvalue is None
and the case for whenvalue is not None
, but this additional code block changes that. This new code block means that there are now two places where we would be "branching" on whether avalue is None
ornot
: Firstly, in the new code block, and secondly, in the original if-else block. Therefore, I think the new change might make it more difficult to follow the code compared to the original PR where the change was only made to the code that affectsfillna
withaxis = 1
andvalue is not None
.