bigframes.bigquery.to_json#
- bigframes.bigquery.to_json(input: Series) Series[source]#
Converts a series with a JSON value to a JSON-formatted STRING value.
Examples:
>>> import bigframes.pandas as bpd >>> import bigframes.bigquery as bbq
>>> s = bpd.Series([1, 2, 3]) >>> bbq.to_json(s) 0 1 1 2 2 3 dtype: extension<dbjson<JSONArrowType>>[pyarrow]
>>> s = bpd.Series([{"int": 1, "str": "pandas"}, {"int": 2, "str": "numpy"}]) >>> bbq.to_json(s) 0 {"int":1,"str":"pandas"} 1 {"int":2,"str":"numpy"} dtype: extension<dbjson<JSONArrowType>>[pyarrow]
- Parameters:
input (bigframes.series.Series) – The Series containing JSON or JSON-formatted string values.
- Returns:
A new Series with the JSON value.
- Return type: