# xarray.DataArray.broadcast_equals

#### DataArray.broadcast_equals(other)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/dataarray.py#L4827-L4874)

Two DataArrays are broadcast equal if they are equal after
broadcasting them against each other such that they have the same
dimensions.

* **Parameters:**
  **other** ([`DataArray`](xarray.DataArray.html.md#xarray.DataArray)) – DataArray to compare to.
* **Returns:**
  **equal** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool)) – True if the two DataArrays are broadcast equal.

#### SEE ALSO
[`DataArray.equals`](xarray.DataArray.equals.html.md#xarray.DataArray.equals), [`DataArray.identical`](xarray.DataArray.identical.html.md#xarray.DataArray.identical)

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('219a7f34-85a4-4af8-a89d-a756507fdec1','e8655205-2464-4e9a-8eab-ef6fc87654bf','ed83247b-e12c-44c0-98b1-7fe7a3e9bf4b','../lite/tree/../notebooks/index.html?path=a99193fa_77d4_493e_9a93_5f7f6b03a189.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> a = xr.DataArray([1, 2], dims="X")
>>> b = xr.DataArray([[1, 1], [2, 2]], dims=["X", "Y"])
>>> a
<xarray.DataArray (X: 2)> Size: 16B
array([1, 2])
Dimensions without coordinates: X
>>> b
<xarray.DataArray (X: 2, Y: 2)> Size: 32B
array([[1, 1],
       [2, 2]])
Dimensions without coordinates: X, Y
```

.equals returns True if two DataArrays have the same values, dimensions, and coordinates. .broadcast_equals returns True if the results of broadcasting two DataArrays against each other have the same values, dimensions, and coordinates.

```pycon
>>> a.equals(b)
False
>>> a2, b2 = xr.broadcast(a, b)
>>> a2.equals(b2)
True
>>> a.broadcast_equals(b)
True
```

<div id="ed83247b-e12c-44c0-98b1-7fe7a3e9bf4b" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('219a7f34-85a4-4af8-a89d-a756507fdec1','ed83247b-e12c-44c0-98b1-7fe7a3e9bf4b')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('219a7f34-85a4-4af8-a89d-a756507fdec1','ed83247b-e12c-44c0-98b1-7fe7a3e9bf4b')">Open In Tab</button></div><div id="e8655205-2464-4e9a-8eab-ef6fc87654bf" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
