Skip to content

BUG: ArrayManager reindex with copy=True not copying #42647

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 6 commits into from
Aug 4, 2021

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

cols = np.arange(N)
np.random.shuffle(cols)

result = df.reindex(columns=cols, copy=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

can you check with both axis reindexing as well (result should be the same) e.g. only a single copy.

Copy link
Member Author

Choose a reason for hiding this comment

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

do you mean calling df.reindex(index=foo, copy=True)? that's covered by existing tests. this test should be focused on the particular bug

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah actually meant calling them both (columns AND index)

Copy link
Member Author

Choose a reason for hiding this comment

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

updated + greenish

@jreback jreback added this to the 1.4 milestone Jul 28, 2021
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@jreback jreback merged commit 17c6798 into pandas-dev:master Aug 4, 2021
@jreback
Copy link
Contributor

jreback commented Aug 4, 2021

thanks, can you add on a whatsnew note at some point.

@jbrockmendel jbrockmendel deleted the perf-reindex branch August 4, 2021 22:48
feefladder pushed a commit to feefladder/pandas that referenced this pull request Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants