bigframes.pandas.api.typing.StringMethods.cat#
- StringMethods.cat(others: str | Index | Series, *, join: Literal['outer', 'left'] = 'left') T[source]#
Concatenate strings in the Series/Index with given separator.
If others is specified, this function concatenates the Series/Index and elements of others element-wise.
Examples:
>>> import bigframes.pandas as bpd
You can concatenate each string in a Series to another string.
>>> s = bpd.Series(['Jane', 'John']) >>> s.str.cat(" Doe") 0 Jane Doe 1 John Doe dtype: string
You can concatenate another Series. By default left join is performed to align the corresponding elements.
>>> s.str.cat(bpd.Series([" Doe", " Foe", " Roe"])) 0 Jane Doe 1 John Foe dtype: string
>>> s.str.cat(bpd.Series([" Doe", " Foe", " Roe"], index=[2, 0, 1])) 0 Jane Foe 1 John Roe dtype: string
You can enforce an outer join.
>>> s.str.cat(bpd.Series([" Doe", " Foe", " Roe"]), join="outer") 0 Jane Doe 1 John Foe 2 <NA> dtype: string
- Parameters:
join ({'left', 'outer'}, default 'left') – Determines the join-style between the calling Series and any Series in others (objects without an index need to match the length of the calling Series). To disable alignment, use .values on any Series/Index/DataFrame in others.
- Returns:
Series with concatenated strings.
- Return type: