# xarray.Dataset.broadcast_equals

#### Dataset.broadcast_equals(other)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/dataset.py#L1640-L1705)

Two Datasets are broadcast equal if they are equal after
broadcasting all variables against each other.

For example, variables that are scalar in one dataset but non-scalar in
the other dataset can still be broadcast equal if the the non-scalar
variable is a constant.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('32b56cc6-de57-4280-ba1e-3c0fe9b08642','32c8c63f-c538-49d9-9ffe-a506f6010c14','0583769b-3545-4fe8-bb77-6bcaec8c776d','../lite/tree/../notebooks/index.html?path=bdad2e3b_8a2b_475d_90e8_d26dcff7b51d.ipynb','None')">Try it in your browser!</button></div>

# 2D array with shape (1, 3)

```pycon
>>> data = np.array([[1, 2, 3]])
>>> a = xr.Dataset(
...     {"variable_name": (("space", "time"), data)},
...     coords={"space": [0], "time": [0, 1, 2]},
... )
>>> a
<xarray.Dataset> Size: 56B
Dimensions:        (space: 1, time: 3)
Coordinates:
  * space          (space) int64 8B 0
  * time           (time) int64 24B 0 1 2
Data variables:
    variable_name  (space, time) int64 24B 1 2 3
```

# 2D array with shape (3, 1)

```pycon
>>> data = np.array([[1], [2], [3]])
>>> b = xr.Dataset(
...     {"variable_name": (("time", "space"), data)},
...     coords={"time": [0, 1, 2], "space": [0]},
... )
>>> b
<xarray.Dataset> Size: 56B
Dimensions:        (time: 3, space: 1)
Coordinates:
  * time           (time) int64 24B 0 1 2
  * space          (space) int64 8B 0
Data variables:
    variable_name  (time, space) int64 24B 1 2 3
```

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

```pycon
>>> a.equals(b)
False
```

```pycon
>>> a.broadcast_equals(b)
True
```

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

<div id="0583769b-3545-4fe8-bb77-6bcaec8c776d" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('32b56cc6-de57-4280-ba1e-3c0fe9b08642','0583769b-3545-4fe8-bb77-6bcaec8c776d')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('32b56cc6-de57-4280-ba1e-3c0fe9b08642','0583769b-3545-4fe8-bb77-6bcaec8c776d')">Open In Tab</button></div><div id="32c8c63f-c538-49d9-9ffe-a506f6010c14" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>

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