Skip to content

TST: boolean indexing using .iloc #20627 #34622

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 5 commits into from
Jun 13, 2020

Conversation

OlivierLuG
Copy link
Contributor

A simple test was added to close this issue.

@WillAyd
Copy link
Member

WillAyd commented Jun 7, 2020

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

def test_iloc_with_boolean_operation():
# GH 20627
result = DataFrame([[0, 1], [2, 3], [4, 5], [6, np.nan]])
result.iloc[result.index <= 2] *= 2
Copy link
Contributor

Choose a reason for hiding this comment

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

you need to copy result each time you are using it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you sure ? result is modified inplace ? (or I don't understand)

Copy link
Contributor

Choose a reason for hiding this comment

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

i get it. for each part of the test you want to reconstruct result, so that the in place mods only affect 1 part and are not consecutive.

@jreback jreback changed the title added a test for issue #20627 TST: boolean indexing using .iloc #20627 Jun 8, 2020
@jreback jreback added the Indexing Related to indexing on series/frames, not to indexes themselves label Jun 8, 2020
@jreback jreback added this to the 1.1 milestone Jun 9, 2020
@jreback jreback added the Testing pandas testing functions or related to the test suite label Jun 9, 2020
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.

comment & pls ping on green.

@OlivierLuG
Copy link
Contributor Author

I think everything is done. The last PR is green.

@mroeschke mroeschke merged commit 2e90c7f into pandas-dev:master Jun 13, 2020
@mroeschke
Copy link
Member

Thanks @OlivierLuG

@OlivierLuG OlivierLuG deleted the TST_20627 branch January 2, 2021 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Indexing Related to indexing on series/frames, not to indexes themselves Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modifying dataframe with float values using .iloc and boolean indexing raises ValueError
4 participants