Skip to content

Commit

Permalink
Fix inconsistent usage of 'results' and 'records' in read-json.md (#1…
Browse files Browse the repository at this point in the history
…5766)

* Fix inconsistent usage of 'results' and 'records' in `docs/cudf/source/user_guide/io/read-json.md`

Authors:
  - David Gardner (https://github.com/dagardner-nv)
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Nghia Truong (https://github.com/ttnghia)

URL: #15766
  • Loading branch information
dagardner-nv authored Jul 25, 2024
1 parent a36dacb commit a33f520
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/cudf/source/user_guide/io/read-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ reads a JSON object as a single line and then extracts the
# first read the JSON object with line=True
>>> df = cudf.read_json(j, lines=True)
>>> df
metadata records
metadata results
0 {'vehicle': 'car'} [{'id': 0, 'distance': 1.2}, {'id': 1, 'distan...

# then explode the 'records' column
>>> df = df['records'].explode().struct.explode()
# then explode the 'results' column
>>> df = df['results'].explode().struct.explode()
>>> df
id distance
0 0 1.2
Expand Down

0 comments on commit a33f520

Please sign in to comment.