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.0 is returned. If the key is found, but the value cannot be parsed as an int, returns a 0.0.
This function returns the value as a float. If you want a string, use px.pluck
. If you want an int, use px.pluck_int64
.
The value for the key as a float
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.p50_latency = px.pluck_float64(df.http_data, 'p50_latency') # 5.1