# xarray.ufuncs.degrees

### xarray.ufuncs.degrees *= <xarray.ufuncs._unary_ufunc object>*

xarray specific variant of `numpy.degrees()`. Handles xarray objects by dispatching to the appropriate function for the underlying array type.

Documentation from numpy:

Convert angles from radians to degrees.

* **Parameters:**
  * **x** ([array_like](https://numpy.org/doc/stable/glossary.html#term-array_like)) – Input array in radians.
  * **out** ([`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray), [`None`](https://docs.python.org/3/builtins/constants.html#None), or [`tuple`](https://docs.python.org/3/builtins/stdtypes.html#tuple) of [`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) and [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – A location into which the result is stored. If provided, it must have
    a shape that the inputs broadcast to. If not provided or None,
    a freshly-allocated array is returned. A tuple (possible only as a
    keyword argument) must have length equal to the number of outputs.
  * **where** ([array_like](https://numpy.org/doc/stable/glossary.html#term-array_like), *optional*) – This condition is broadcast over the input. At locations where the
    condition is True, the out array will be set to the ufunc result.
    Elsewhere, the out array will retain its original value.
    Note that if an uninitialized out array is created via the default
    `out=None`, locations within it where the condition is False will
    remain uninitialized.
  * **\*\*kwargs** – For other keyword-only arguments, see the
    [ufunc docs](https://numpy.org/doc/stable/reference/ufuncs.html#ufuncs-kwargs).
* **Returns:**
  **y** ([`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) of `floats`) – The corresponding degree values; if out was supplied this is a
  reference to it.
  This is a scalar if x is a scalar.

#### SEE ALSO
[`rad2deg`](xarray.ufuncs.rad2deg.html.md#xarray.ufuncs.rad2deg)
: equivalent function

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('007edeb3-7543-4f0f-8519-87ffc0f9f55a','44440d41-b95e-4051-9041-334a2d100050','eb78c669-f7aa-4ee0-a16e-8b6a84bce039','../lite/tree/../notebooks/index.html?path=ffbdbe6d_f2b7_4cfa_a4a0_31c846834fc1.ipynb','None')">Try it in your browser!</button></div>

Convert a radian array to degrees

```pycon
>>> import numpy as np
>>> rad = np.arange(12.)*np.pi/6
>>> np.degrees(rad)
array([   0.,   30.,   60.,   90.,  120.,  150.,  180.,  210.,  240.,
        270.,  300.,  330.])
```

```pycon
>>> out = np.zeros((rad.shape))
>>> r = np.degrees(rad, out)
>>> np.all(r == out)
True
```

<div id="eb78c669-f7aa-4ee0-a16e-8b6a84bce039" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('007edeb3-7543-4f0f-8519-87ffc0f9f55a','eb78c669-f7aa-4ee0-a16e-8b6a84bce039')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('007edeb3-7543-4f0f-8519-87ffc0f9f55a','eb78c669-f7aa-4ee0-a16e-8b6a84bce039')">Open In Tab</button></div><div id="44440d41-b95e-4051-9041-334a2d100050" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
