pyarrow.json_#

pyarrow.json_(DataTypestorage_type=utf8())#

Create instance of JSON extension type.

Parameters:
storage_typeDataType, defaultpyarrow.string()

The underlying data type. Can be on of the following types:string, large_string, string_view.

Returns:
typeJsonType

Examples

Create an instance of JSON extension type:

>>>importpyarrowaspa>>>pa.json_(pa.utf8())JsonType(extension<arrow.json>)

Use the JSON type to create an array:

>>>pa.array(['{"a": 1}','{"b": 2}'],type=pa.json_(pa.utf8()))<pyarrow.lib.JsonArray object at ...>[  "{"a": 1}",  "{"b": 2}"]