We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
columns
data=None
data={}
Describe the bug
When constructing an empty dataframe where one does not explicitly specify the column names, pandas produces a RangeIndex for the .columns property.
RangeIndex
.columns
In contrast, cudf produces an Index(dtype=object) if data={} or data=None.
Index(dtype=object)
Steps/Code to reproduce bug
import cudf import pandas as pd for data in [{}, None]: columns = cudf.DataFrame(data=data).columns expect = pd.DataFrame(data=data).columns assert type(columns) == type(expect)
Expected behavior
Matching pandas. This works if data is an empty list-like object (e.g. data=[]) so it's probably just another condition to handle.
data
data=[]
The text was updated successfully, but these errors were encountered:
Match pandas in column index type for empty dataframes
3ad0e2d
- Closes rapidsai#15372
Add test of rapidsai#15372
bb3f865
wence-
No branches or pull requests
Describe the bug
When constructing an empty dataframe where one does not explicitly specify the column names, pandas produces a
RangeIndex
for the.columns
property.In contrast, cudf produces an
Index(dtype=object)
ifdata={}
ordata=None
.Steps/Code to reproduce bug
Expected behavior
Matching pandas. This works if
data
is an empty list-like object (e.g.data=[]
) so it's probably just another condition to handle.The text was updated successfully, but these errors were encountered: