Skip to content

TST: avoid mutating DataFrame.values in tests (use iloc instead) #51301

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 1 commit into from
Feb 11, 2023

Conversation

jorisvandenbossche
Copy link
Member

This is splitting off some "usefully anyway" test changes from #51082

We have several places internally where we mutate the df.values[..] = .. directly, while this is certainly a discouraged pattern (also only work if you have a single block), and often easily avoided by using df.iloc[..] = .. or mutating the array before creating the DataFrame, instead.

@jorisvandenbossche jorisvandenbossche added the Testing pandas testing functions or related to the test suite label Feb 10, 2023
@phofl phofl added this to the 2.0 milestone Feb 11, 2023
@phofl phofl merged commit 341b579 into pandas-dev:main Feb 11, 2023
@phofl
Copy link
Member

phofl commented Feb 11, 2023

thx @jorisvandenbossche

@jorisvandenbossche jorisvandenbossche deleted the tests-values-iloc branch February 14, 2023 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants