[ Web Proxy ]
URL:
Viewing: https://dataframes.bigquery.dev/reference/api/bigframes.bigquery.array_to_string.html [Back]  [Original]

bigframes.bigquery.array_to_string — bigframes documentation
Back to top
Search the docs ...:

bigframes.bigquery.array_to_string#

bigframes.bigquery.array_to_string(series: Series | Expression | Any | Literal[Sentinel.ARGUMENT_DEFAULT], delimiter: Series | Expression | Literal[Sentinel.ARGUMENT_DEFAULT] | bytes | str, null_text: Series | Expression | Literal[Sentinel.ARGUMENT_DEFAULT] | bytes | str = Sentinel.ARGUMENT_DEFAULT) Series | Expression[source]#

Converts array elements within a Series into delimited strings.

Examples:

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> s = bpd.Series([["H", "i", "!"], ["Hello", "World"], np.nan, [], ["Hi"]])
>>> bbq.array_to_string(s, delimiter=", ")
0         H, i, !
1    Hello, World
2
3
4              Hi
dtype: string

You can call this function using the Series bigquery accessor.

>>> s.bigquery.array_to_string(delimiter=", ")
0         H, i, !
1    Hello, World
2
3
4              Hi
dtype: string

You can also use this accessor on a pandas Series after importing bigframes.

>>> import bigframes
>>> import pandas as pd
>>> ps = pd.Series([["H", "i", "!"], ["Hello", "World"], None, [], ["Hi"]])
>>> ps.bigquery.array_to_string(delimiter=", ")
0         H, i, !
1    Hello, World
2
3
4              Hi
dtype: string
Parameters:
  • series (bigframes.series.Series) A Series containing arrays.

  • delimiter (str) The string used to separate array elements.

  • null_text (str, optional) The string to replace any NULL values in the array with.

Returns:

A Series containing delimited strings.

Return type:

bigframes.series.Series


Web Proxy Viewer  |  New URL  |  Original Page