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

Function method

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

Source from the content-addressed store, hash-verified

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

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