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

[BUG]: cudf.DataFrame does not map namedtuple field names to column names like pandas #13823

Closed
mroeschke opened this issue Aug 5, 2023 · 0 comments · Fixed by #13824
Closed
Assignees
Labels
2 - In Progress Currently a work in progress bug Something isn't working

Comments

@mroeschke
Copy link
Contributor

Describe the bug
cudf.DataFrame does not map namedtuple field names to column names like pandas

Steps/Code to reproduce bug
Follow this guide http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports to craft a minimal bug report. This helps us reproduce the issue you're having and resolve the issue more quickly.

from collections import namedtuple
import cudf
import pandas

Point = namedtuple("Point", "x y")

pandas.DataFrame([Point(0, 0), Point(0, 3), (2, 3)])
#    x  y
# 0  0  0
# 1  0  3
# 2  2  3

cudf.DataFrame([Point(0, 0), Point(0, 3), (2, 3)])
#    0  1
# 0  0  0
# 1  0  3
# 2  2  3

Expected behavior
The cudf result should match the result

Environment overview (please complete the following information)

# Name                    Version                   Build  Channel
pandas                    1.5.3           py310h9b08913_1    conda-forge

# Name                    Version                   Build  Channel
cudf                      23.10.00a       cuda11_py310_230804_gd8bf9d2534_53    rapidsai-nightly
libcudf                   23.10.00a       cuda11_230803_g15cc501190_51    rapidsai-nightly

Environment details
Please run and paste the output of the cudf/print_env.sh script here, to gather any other relevant environment details

Additional context
Add any other context about the problem here.

@mroeschke mroeschke added bug Something isn't working Needs Triage Need team to review and classify labels Aug 5, 2023
@wence- wence- added 2 - In Progress Currently a work in progress and removed Needs Triage Need team to review and classify labels Aug 7, 2023
rapids-bot bot pushed a commit that referenced this issue Aug 9, 2023
Allow namedtuple's `_field` attribute to be mapped to DataFrame column labels like pandas

closes #13823

Authors:
  - Matthew Roeschke (https://github.com/mroeschke)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)
  - Lawrence Mitchell (https://github.com/wence-)

URL: #13824
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - In Progress Currently a work in progress bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants