Shortcuts

torcharrow.istring_column.StringMethods.split

abstract StringMethods.split(pat=None, n=- 1)

Split strings around given separator/delimiter.

Parameters:
  • str (pat -) – String literal to split on, does not yet support regular expressions. When None split according to whitespace.

  • None (default) – String literal to split on, does not yet support regular expressions. When None split according to whitespace.

  • int (n -) – Maximum number of splits to do. 0 will be interpreted as return all splits.

  • limit (default -1 means no) – Maximum number of splits to do. 0 will be interpreted as return all splits.

See also

list.join

Examples

>>> import torcharrow as ta
>>> s = ta.column(['what a wonderful world!', 'really?'])
>>> s.str.split(pat=' ')
0  ['what', 'a', 'wonderful', 'world!']
1  ['really?']
dtype: List(string), length: 2, null_count: 0
>>> s.str.split(pat=' ', n=2)
0  ['what', 'a', 'wonderful world!']
1  ['really?']
dtype: List(string), length: 2, null_count: 0

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources