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

Add custom getitem to cudf.pandas #17729

Draft
wants to merge 5 commits into
base: branch-25.02
Choose a base branch
from

Conversation

galipremsagar
Copy link
Contributor

@galipremsagar galipremsagar commented Jan 13, 2025

Description

This PR improves the getitem times by avoiding a lot of the cudf.pandas machinery if it's a simple scalar getitem.

# on branch-25.02:

In [1]: %load_ext cudf.pandas

In [2]: import pandas as pd

In [3]: s = pd.Series([1, 2, None, 5, 3])

In [4]: %timeit s[0]
3.32 ms ± 37.1 μs per loop (mean ± std. dev. of 7 runs, 100 loops each)


# This PR:

In [1]: %load_ext cudf.pandas

In [2]: import pandas as pd

In [3]: s = pd.Series([1, 2, None, 5, 3])

In [4]: %timeit s[0]
3.02 μs ± 19.9 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)

```

## Checklist
- [x] I am familiar with the [Contributing Guidelines](https://github.com/rapidsai/cudf/blob/HEAD/CONTRIBUTING.md).
- [x] New or existing tests cover these changes.
- [x] The documentation is up to date with these changes.

Copy link

copy-pr-bot bot commented Jan 13, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions bot added Python Affects Python cuDF API. cudf.pandas Issues specific to cudf.pandas labels Jan 13, 2025
@galipremsagar
Copy link
Contributor Author

/okay to test

@galipremsagar galipremsagar added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jan 13, 2025
@galipremsagar
Copy link
Contributor Author

/okay to test

@galipremsagar
Copy link
Contributor Author

/okay to test

@galipremsagar
Copy link
Contributor Author

/okay to test

@galipremsagar
Copy link
Contributor Author

/okay to test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cudf.pandas Issues specific to cudf.pandas improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant