EXPAND ALL
  • Home

pluck_int64

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.

Returns: INT64

The value for the key as an int.

Arguments

VariableTypeDescription
json_strSTRINGJSON data serialized as a string.
keySTRINGThe key to get the value for.

Examples:

df.http_data = '{"status_code": 200, "p50_latency": 5.1}'
df.status_code = px.pluck_int64(df.http_data, 'status_code') # 200
This site uses cookies to provide you with a better user experience. By using Pixie, you consent to our use of cookies.