EXPAND ALL
- Home
- About Pixie
- Installing Pixie
- Using Pixie
- Tutorials
- Reference
Convenience method to handle grabbing the ith item in an array from a serialized JSON string. The function parses the array JSON string and attempts to find the ith element. If the JSON string is not an array, or the index is out of range, an empty string is returned. This function returns the ith element as a string.
The value at the ith position in the array as a string.
Variable | Type | Description |
---|---|---|
json_str | STRING | JSON data serialized as a string. |
index | INT64 | The index of the value in the array. |
df.json = '{"names": ["foo", "bar"]}'df.names = px.pluck(df.json, "names") # Returns ["foo", "bar"]df.name0 = px.pluck_array(df.names, 0) # Returns "foo"df.name5 = px.pluck_array(df.names, 5) # Returns ""