_safe_indexing
triggers SettingWithCopyWarning
when used with slice
#31290
Labels
_safe_indexing
triggers SettingWithCopyWarning
when used with slice
#31290
Describe the bug
Here's something I noticed while looking into #31127
The test
checks that a copy is produced, and that no
SettingWithCopyWarning
is producedIndeed, no copy is raised, but why is using
_safe_indexing
with a slice allowed to not make a copy? Is this intentional?Based on responses, I can suggest what to do instead in #31127
(I am a little surprised that this always makes copies, given that a lot of the discussion in #28341 centered around wanting to avoid copies)
Steps/Code to Reproduce
Expected Results
No
SettingWithCopyWarning
Actual Results
Versions
The text was updated successfully, but these errors were encountered: