[ Web Proxy ]
URL:
Viewing: https://dataframes.bigquery.dev/reference/api/bigframes.pandas.api.typing.StringMethods.split.html [Back]  [Original]

bigframes.pandas.api.typing.StringMethods.split — bigframes documentation
Back to top
Search the docs ...:

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 arent currently supported. Please set regex=False when pat length is not 1.

Returns:

Type matches caller.

Return type:

bigframes.series.Series


Web Proxy Viewer  |  New URL  |  Original Page