MCPcopy
hub / github.com/pydata/xarray / broadcast_like

Method broadcast_like

xarray/core/dataset.py:3336–3360  ·  view source on GitHub ↗

Broadcast this DataArray against another Dataset or DataArray. This is equivalent to xr.broadcast(other, self)[1] Parameters ---------- other : Dataset or DataArray Object against which to broadcast this array. exclude : iterable of hashable, opti

(
        self,
        other: T_DataArrayOrSet,
        exclude: Iterable[Hashable] | None = None,
    )

Source from the content-addressed store, hash-verified

3334 return self.isel(indexers_slices)
3335
3336 def broadcast_like(
3337 self,
3338 other: T_DataArrayOrSet,
3339 exclude: Iterable[Hashable] | None = None,
3340 ) -> Self:
3341 """Broadcast this DataArray against another Dataset or DataArray.
3342 This is equivalent to xr.broadcast(other, self)[1]
3343
3344 Parameters
3345 ----------
3346 other : Dataset or DataArray
3347 Object against which to broadcast this array.
3348 exclude : iterable of hashable, optional
3349 Dimensions that must not be broadcasted
3350
3351 """
3352 if exclude is None:
3353 exclude = set()
3354 else:
3355 exclude = set(exclude)
3356 args = align(other, self, join="outer", copy=False, exclude=exclude)
3357
3358 dims_map, common_coords = _get_broadcast_dims_map_common_coords(args, exclude)
3359
3360 return _broadcast_helper(args[1], exclude, dims_map, common_coords)
3361
3362 def _reindex_callback(
3363 self,

Callers 11

test_broadcast_likeMethod · 0.95
_temp_dataarrayFunction · 0.45
newplotfuncFunction · 0.45
_binary_opMethod · 0.45
curvefitFunction · 0.45
test_broadcast_likeMethod · 0.45
test_polyfit_weightedMethod · 0.45
test_broadcast_likeMethod · 0.45
test_broadcast_likeMethod · 0.45

Calls 3

alignFunction · 0.90
_broadcast_helperFunction · 0.90

Tested by 7

test_broadcast_likeMethod · 0.76
test_broadcast_likeMethod · 0.36
test_polyfit_weightedMethod · 0.36
test_broadcast_likeMethod · 0.36
test_broadcast_likeMethod · 0.36