MCPcopy Create free account
hub / github.com/dask/dask / cat

Method cat

dask/dataframe/dask_expr/_str_accessor.py:106–120  ·  view source on GitHub ↗
(self, others=None, sep=None, na_rep=None)

Source from the content-addressed store, hash-verified

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)

Callers 5

operationMethod · 0.80
reduction_chunkMethod · 0.80
test_str_accessor_catFunction · 0.80
test_str_accessor_catFunction · 0.80

Calls 4

new_collectionFunction · 0.90
CatClass · 0.85
allFunction · 0.85
CatBlockwiseClass · 0.85

Tested by 3

test_str_accessor_catFunction · 0.64
test_str_accessor_catFunction · 0.64