Skip to content

JsonReadOptions(layout=JsonLayout.RECORDS, column_names=ColumnNames.CLEANED) Source

Settings of a JSON file read by Table.from_json.

JSON files are always read in UTF-8.

Added in version 0.1.0

Parameters:

Raises:

Examples:

import tempfile
from pathlib import Path
import numdaplot as ndp

path = Path(tempfile.mkdtemp()) / "sales.jsonl"
_ = path.write_text('{"city": "Paris", "count": 2}\n{"city": "Lyon", "count": 5}\n')
ndp.Table.from_json(path, ndp.JsonReadOptions(layout=ndp.JsonLayout.LINES))
#     city count
#     TEXT INT64
# 0  Paris     2
# 1   Lyon     5