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] Selection of rows by label renders dataframe invalid #18242

Open
gg-tmp opened this issue Mar 12, 2025 · 0 comments · May be fixed by #18254
Open

[BUG] Selection of rows by label renders dataframe invalid #18242

gg-tmp opened this issue Mar 12, 2025 · 0 comments · May be fixed by #18254
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@gg-tmp
Copy link

gg-tmp commented Mar 12, 2025

Describe the bug
Selection of rows by label renders dataframe invalid

Steps/Code to reproduce bug

import cudf
import numpy as np

idx_1 = ["Hi", "Lo"]
idx_2 = ["I", "II", "III"]
idx = cudf.MultiIndex.from_product([idx_1, idx_2])

data_rand = np.random.uniform(0, 1, 3 * len(idx)).reshape(3,-1)
df = cudf.DataFrame(data_rand, index=["A", "B", "C"], columns=idx)

print(df.shape)
# (3, 6) -> OK

tmp = df.loc[["A", "B"]]

print(df.shape)
# (3,7) -> NOT OK

# print(df2) -> raises error
# "ValueError: rangeindex=True and multiindex=True cannot both be True."

print(cudf.__version__)
# 25.02.02

Expected behavior

  1. The shape and content of df should not change
  2. Printing of df should work

Environment overview (please complete the following information)

  • Environment location: Bare-metal
  • Method of cuDF install: conda

Environment details
I could not locate the script cudf/print_env.sh.

  • Ubuntu 24.04 under WSL2
  • cudf.__version__: 25.02.02
@gg-tmp gg-tmp added the bug Something isn't working label Mar 12, 2025
@galipremsagar galipremsagar self-assigned this Mar 12, 2025
@galipremsagar galipremsagar moved this from Todo to In Progress in cuDF Python Mar 12, 2025
@galipremsagar galipremsagar linked a pull request Mar 12, 2025 that will close this issue
3 tasks
@galipremsagar galipremsagar added the Python Affects Python cuDF API. label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Affects Python cuDF API.
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants