bigframes.pandas.api.typing.StringMethods.split#

StringMethods.split(pat: str = ' ', regex: bool | None = None) T[source]#

Split strings around given separator/delimiter.

Examples:

>>> import bigframes.pandas as bpd
>>> s = bpd.Series(
...     [
...         "a regular sentence",
...         "https://docs.python.org/index.html",
...         np.nan
...     ]
... )
>>> s.str.split()
0                ['a' 'regular' 'sentence']
1    ['https://docs.python.org/index.html']
2                                        []
dtype: list<item: string>[pyarrow]

The pat parameter can be used to split by other characters.

>>> s.str.split("//", regex=False)
0                     ['a regular sentence']
1    ['https:' 'docs.python.org/index.html']
2                                         []
dtype: list<item: string>[pyarrow]
Parameters:
  • pat (str, default " ") – String to split on. If not specified, split on whitespace.

  • regex (bool, default None) – Determines if the passed-in pattern is a regular expression. Regular expressions aren’t currently supported. Please set regex=False when pat length is not 1.

Returns:

Type matches caller.

Return type:

bigframes.series.Series