-
Notifications
You must be signed in to change notification settings - Fork 967
Closed
Labels
0 - BacklogIn queue waiting for assignmentIn queue waiting for assignmentbugSomething isn't workingSomething isn't workingcuIOcuIO issuecuIO issue
Description
Describe the bug
Documentation for the index
argument for cudf.DataFrame.to_json
https://docs.rapids.ai/api/cudf/stable/api_docs/api/cudf.DataFrame.to_json.html
states:
indexbool, default True
Whether to include the index values in the JSON string. Not including the index (index=False) is only supported when orient is ‘split’ or ‘table’.
However this is ignored, and appears to be caused by Pandas as cudf's to_json uses Panda's to_json.
pandas-dev/pandas#37600
Steps/Code to reproduce bug
Issue can be reproduced in both cudf and pandas.
cudf repro:
import cudf
df = cudf.DataFrame([3,4,5,6])
# Including CSV output for comparison
print(df.to_csv(header=True, index=True))
print(df.to_json(index=True, orient="records"))
Yields this output:
,0
0,3
1,4
2,5
3,6
[{"0":3},{"0":4},{"0":5},{"0":6}]
Pandas repro:
import pandas
df = pandas.DataFrame([3,4,5,6])
# Including CSV output for comparison
print(df.to_csv(header=True, index=True))
print(df.to_json(index=True, orient="records"))
Expected behavior
Include index column when index=True
Environment overview (please complete the following information)
- Environment location: Bare-metal
- Method of cuDF install: conda
Metadata
Metadata
Assignees
Labels
0 - BacklogIn queue waiting for assignmentIn queue waiting for assignmentbugSomething isn't workingSomething isn't workingcuIOcuIO issuecuIO issue