# 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('5b3082fa-15aa-4a74-9405-2038031162d0','b35202aa-35a6-4635-ace1-4649a169f19d','a8adb9aa-daf3-4f66-8a4e-41e7eca59e8d','../lite/tree/../notebooks/index.html?path=0688ef55_c7fa_4b9b_805c_a053c2eeeb67.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="a8adb9aa-daf3-4f66-8a4e-41e7eca59e8d" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('5b3082fa-15aa-4a74-9405-2038031162d0','a8adb9aa-daf3-4f66-8a4e-41e7eca59e8d')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('5b3082fa-15aa-4a74-9405-2038031162d0','a8adb9aa-daf3-4f66-8a4e-41e7eca59e8d')">Open In Tab</button></div><div id="b35202aa-35a6-4635-ace1-4649a169f19d" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
