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] Avoid materializing index when list of Series are used to construct DataFrame #10070

Closed
galipremsagar opened this issue Jan 18, 2022 · 0 comments · Fixed by #10071
Closed
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@galipremsagar
Copy link
Contributor

Describe the bug
We are materializing RangeIndex when creating a dataframe from list of Series objects.

Steps/Code to reproduce bug

>>> import cudf
>>> s = cudf.Series([1, 2, 3], index=['a', 'b', 'c'])
>>> cudf.DataFrame([s, s, s])
>>> cudf.DataFrame([s, s, s]).index
Int64Index([0, 1, 2], dtype='int64')
>>> import pandas as pd
>>> pd.DataFrame([s.to_pandas(), s.to_pandas(), s.to_pandas()]).index
RangeIndex(start=0, stop=3, step=1)

Expected behavior

>>> cudf.DataFrame([s, s, s]).index
RangeIndex(start=0, stop=3, step=1)

Environment overview (please complete the following information)

  • Environment location: [Bare-metal]
  • Method of cuDF install: [from source]
@galipremsagar galipremsagar added bug Something isn't working Python Affects Python cuDF API. labels Jan 18, 2022
@galipremsagar galipremsagar self-assigned this Jan 18, 2022
rapids-bot bot pushed a commit that referenced this issue Jan 19, 2022
… `Series` objects (#10071)

Fixes: #10070 

This PR removed materializing of `index` incase of list-like un-named `Series` inputs are passed to `DataFrame` constructor.

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Ashwin Srinath (https://github.com/shwina)

URL: #10071
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
None yet
1 participant