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

Function method

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

Source from the content-addressed store, hash-verified

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

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