@@ -57,8 +57,7 @@ def array_length(series: series.Series) -> series.Series:
57
57
dtype: Int64
58
58
59
59
Args:
60
- series (bigframes.series.Series):
61
- A Series with array columns.
60
+ series (bigframes.series.Series): A Series with array columns.
62
61
63
62
Returns:
64
63
bigframes.series.Series: A Series of integer values indicating
@@ -104,7 +103,7 @@ def array_agg(
104
103
105
104
Args:
106
105
obj (groupby.SeriesGroupBy | groupby.DataFrameGroupBy):
107
- A GroupBy object to be applied the function.
106
+ A GroupBy object to be applied the function.
108
107
109
108
Returns:
110
109
bigframes.series.Series | bigframes.dataframe.DataFrame: A Series or
@@ -119,3 +118,33 @@ def array_agg(
119
118
raise ValueError (
120
119
f"Unsupported type { type (obj )} to apply `array_agg` function. { constants .FEEDBACK_LINK } "
121
120
)
121
+
122
+
123
+ def array_to_string (series : series .Series , delimiter : str ) -> series .Series :
124
+ """Converts array elements within a Series into delimited strings.
125
+
126
+ **Examples:**
127
+
128
+ >>> import bigframes.pandas as bpd
129
+ >>> import bigframes.bigquery as bbq
130
+ >>> import numpy as np
131
+ >>> bpd.options.display.progress_bar = None
132
+
133
+ >>> s = bpd.Series([["H", "i", "!"], ["Hello", "World"], np.nan, [], ["Hi"]])
134
+ >>> bbq.array_to_string(s, delimiter=", ")
135
+ 0 H, i, !
136
+ 1 Hello, World
137
+ 2
138
+ 3
139
+ 4 Hi
140
+ dtype: string
141
+
142
+ Args:
143
+ series (bigframes.series.Series): A Series containing arrays.
144
+ delimiter (str): The string used to separate array elements.
145
+
146
+ Returns:
147
+ bigframes.series.Series: A Series containing delimited strings.
148
+
149
+ """
150
+ return series ._apply_unary_op (ops .ArrayToStringOp (delimiter = delimiter ))
0 commit comments