polars.Series.str.json_decode#
- Series.str.json_decode( ) Series[source]#
 Parse string values as JSON.
Throws an error if invalid JSON strings are encountered.
- Parameters:
 - dtype
 The dtype to cast the extracted value to. If None, the dtype will be inferred from the JSON value.
- infer_schema_length
 How many rows to parse to determine the schema. If
Noneall rows are used.
See also
json_path_matchExtract the first match of json string with provided JSONPath expression.
Examples
>>> s = pl.Series("json", ['{"a":1, "b": true}', None, '{"a":2, "b": false}']) >>> s.str.json_decode() shape: (3,) Series: 'json' [struct[2]] [ {1,true} {null,null} {2,false} ]