cudf.core.column.string.StringMethods.get_json_object#

StringMethods.get_json_object(json_path)#

Applies a JSONPath string to an input strings column where each row in the column is a valid json string

Parameters
json_path: str

The JSONPath string to be applied to each row of the input column

Returns
Column: New strings column containing the retrieved json object strings

Examples

>>> import cudf
>>> s = cudf.Series(
    [
        \"\"\"
        {
            "store":{
                "book":[
                    {
                        "category":"reference",
                        "author":"Nigel Rees",
                        "title":"Sayings of the Century",
                        "price":8.95
                    },
                    {
                        "category":"fiction",
                        "author":"Evelyn Waugh",
                        "title":"Sword of Honour",
                        "price":12.99
                    }
                ]
            }
        }
        \"\"\"
    ])
>>> s
    0    {"store": {\n        "book": [\n        { "cat...
    dtype: object
>>> s.str.get_json_object("$.store.book")
    0    [\n        { "category": "reference",\n       ...
    dtype: object