EXPAND ALL
- Home
- About Pixie
- Installing Pixie
- Using Pixie
- Tutorials
- Reference
Convenience method to handle grabbing keys from a serialized JSON string. The function parses the JSON string and attempts to find the key. If the key is not found, 0 is returned. If the key is found, but the value cannot be parsed as an int, returns a 0.
This function returns the value as an int. If you want a string, use px.pluck
. If you want a float, use px.pluck_float64
.
The value for the key as an int.
Variable | Type | Description |
---|---|---|
json_str | STRING | JSON data serialized as a string. |
key | STRING | The key to get the value for. |
df.http_data = '{"status_code": 200, "p50_latency": 5.1}'df.status_code = px.pluck_int64(df.http_data, 'status_code') # 200