MCPcopy
hub / github.com/dask/dask / method

Function method

dask/dataframe/dask_expr/_collection.py:204–246  ·  view source on GitHub ↗
(self, other, axis="columns", level=None, fill_value=None)

Source from the content-addressed store, hash-verified

202 if class_ == DataFrame:
203
204 def method(self, other, axis="columns", level=None, fill_value=None):
205 if level is not None:
206 raise NotImplementedError("level must be None")
207
208 axis = _validate_axis(axis)
209
210 if (
211 is_dataframe_like(other)
212 or is_series_like(other)
213 and axis in (0, "index")
214 ) and not is_dask_collection(other):
215 other = self._create_alignable_frame(other)
216
217 if axis in (1, "columns"):
218 if isinstance(other, Series):
219 msg = f"Unable to {name} dd.Series with axis=1"
220 raise ValueError(msg)
221
222 frame = self
223 if isinstance(other, FrameBase) and not expr.are_co_aligned(
224 self.expr, other.expr
225 ):
226 return new_collection(
227 expr.MethodOperatorAlign(
228 op=name,
229 frame=frame,
230 other=other,
231 axis=axis,
232 level=level,
233 fill_value=fill_value,
234 )
235 )
236
237 return new_collection(
238 expr.MethodOperator(
239 name=name,
240 left=frame,
241 right=other,
242 axis=axis,
243 level=level,
244 fill_value=fill_value,
245 )
246 )
247
248 elif class_ == Series:
249

Callers 4

_swapFunction · 0.85
_get_binary_operatorMethod · 0.85
normalize_objectFunction · 0.85
make_intFunction · 0.85

Calls 6

_validate_axisFunction · 0.90
is_dask_collectionFunction · 0.90
new_collectionFunction · 0.90
is_dataframe_likeFunction · 0.85
is_series_likeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…