| 104 | return self._split("rsplit", pat=pat, n=n, expand=expand) |
| 105 | |
| 106 | def cat(self, others=None, sep=None, na_rep=None): |
| 107 | import pandas as pd |
| 108 | |
| 109 | from dask.dataframe.dask_expr._collection import Index, Series, new_collection |
| 110 | |
| 111 | if others is None: |
| 112 | return new_collection(Cat(self._series, sep, na_rep)) |
| 113 | |
| 114 | valid_types = (Series, Index, pd.Series, pd.Index) |
| 115 | if isinstance(others, valid_types): |
| 116 | others = [others] |
| 117 | elif not all(isinstance(a, valid_types) for a in others): |
| 118 | raise TypeError("others must be Series/Index") |
| 119 | |
| 120 | return new_collection(CatBlockwise(self._series, sep, na_rep, *others)) |
| 121 | |
| 122 | def __getitem__(self, index): |
| 123 | return self._function_map("__getitem__", index) |