Function scanJson

  • Read a JSON file or string into a DataFrame.

    Note: Currently only newline delimited JSON is supported

    Parameters

    • path: string

      path to json file

      • path: Path to a file or a file like string. Any valid filepath can be used. Example: ./file.json.
    • Optional options: Partial<ScanJsonOptions>

    Returns LazyDataFrame

    (DataFrame)

    Example

    > const df = pl.scanJson('path/to/file.json', {numRows: 2}).collectSync()
    > console.log(df)
    shape: (2, 3)
    ╭─────┬─────┬─────╮
    abc
    │ --- ┆ --- ┆ --- │
    i64stri64
    ╞═════╪═════╪═════╡
    1foo3
    ├╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌┤
    2bar6
    ╰─────┴─────┴─────╯