Skip to content
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

Clean up reshaping ops #16553

Merged
merged 4 commits into from
Aug 16, 2024
Merged

Conversation

mroeschke
Copy link
Contributor

@mroeschke mroeschke commented Aug 13, 2024

Description

Uses some more "idiomatic" cudf patterns such as

  • Checking isinstance(column.dtype, ...) instead of isinstance(column, ...) (to avoid importing the column objects)
  • Using DataFrame._from_data(dict) instead of creating an empty DataFrame and adding columns one by one

Also avoids some column materialization in DataFrame.columns = :

  • For RangeIndex, avoid materializing to a column to get a distinct count
  • For MultiIndex, avoid creating a cudf.MultiIndex with columns as it's converted to a CPU object to get column labels for the ColumnAccessor

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@mroeschke mroeschke added Python Affects Python cuDF API. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Aug 13, 2024
@mroeschke mroeschke requested a review from a team as a code owner August 13, 2024 22:39
@vyasr
Copy link
Contributor

vyasr commented Aug 16, 2024

/merge

@rapids-bot rapids-bot bot merged commit 30011c5 into rapidsai:branch-24.10 Aug 16, 2024
72 checks passed
@mroeschke mroeschke deleted the cln/reshaping branch August 16, 2024 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants