# xarray.ufuncs.positive

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

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

Documentation from numpy:

Numerical positive, element-wise.

* **Parameters:**
  **x** ([array_like](https://numpy.org/doc/stable/glossary.html#term-array_like) or [scalar](../user-guide/terminology.html.md#term-scalar)) – Input array.
* **Returns:**
  **y** ([`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) or [scalar](../user-guide/terminology.html.md#term-scalar)) – Returned array or scalar: y = +x.
  This is a scalar if x is a scalar.

### Notes

Equivalent to x.copy(), but only defined for types that support
arithmetic.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('cbb3652b-fad5-4ea6-a24d-c8325f3d928d','04385198-bb2a-4435-8c48-4b400815d593','30492764-4b9e-4c7c-9216-9a57d188df34','../lite/tree/../notebooks/index.html?path=b98969ff_f9a7_4266_a847_2c1658df7059.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> import numpy as np
```

```pycon
>>> x1 = np.array(([1., -1.]))
>>> np.positive(x1)
array([ 1., -1.])
```

The unary `+` operator can be used as a shorthand for `np.positive` on
ndarrays.

```pycon
>>> x1 = np.array(([1., -1.]))
>>> +x1
array([ 1., -1.])
```

<div id="30492764-4b9e-4c7c-9216-9a57d188df34" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('cbb3652b-fad5-4ea6-a24d-c8325f3d928d','30492764-4b9e-4c7c-9216-9a57d188df34')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('cbb3652b-fad5-4ea6-a24d-c8325f3d928d','30492764-4b9e-4c7c-9216-9a57d188df34')">Open In Tab</button></div><div id="04385198-bb2a-4435-8c48-4b400815d593" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
