Skip to content

Commit 873b6b5

Browse files
committed
Add description to axis, dtype and out keyword
1 parent 53b1a36 commit 873b6b5

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

doc/reference/ndarray.rst

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,25 @@ the operation should proceed.
211211
Calculation
212212
-----------
213213

214+
Many of these methods take an argument named *axis*. In such cases,
215+
216+
- If *axis* is *None* (the default), the array is treated as a 1-D array and
217+
the operation is performed over the entire array. This behavior is also the
218+
default if *self* is a 0-dimensional array.
219+
220+
- If *axis* is an integer, then the operation is done over the given axis (for
221+
each 1-D subarray that can be created along the given axis).
222+
223+
The parameter *dtype* specifies the data type over which a reduction operation
224+
(like summing) should take place. The default reduce data type is the same as
225+
the data type of *self*. To avoid overflow, it can be useful to perform the
226+
reduction using a larger data type.
227+
228+
For several methods, an optional *out* argument can also be provided and the
229+
result will be placed into the output array given. The *out* argument must be
230+
an :class:`dpnp.ndarray` and have the same number of elements. It can have a
231+
different data type in which case casting will be performed.
232+
214233
.. autosummary::
215234
:toctree: generated/
216235
:nosignatures:
@@ -242,12 +261,11 @@ Arithmetic and comparison operations on :class:`dpnp.ndarrays <dpnp.ndarray>`
242261
are defined as element-wise operations, and generally yield
243262
:class:`dpnp.ndarray` objects as results.
244263

245-
Each of the arithmetic operations (``+``, ``-``, ``*``, ``/``, ``//``,
246-
``%``, ``divmod()``, ``**`` or ``pow()``, ``<<``, ``>>``, ``&``,
247-
``^``, ``|``, ``~``) and the comparisons (``==``, ``<``, ``>``,
248-
``<=``, ``>=``, ``!=``) is equivalent to the corresponding
249-
universal function (or :term:`ufunc` for short) in DPNP. For
250-
more information, see the section on :ref:`Universal Functions
264+
Each of the arithmetic operations (``+``, ``-``, ``*``, ``/``, ``//``, ``%``,
265+
``divmod()``, ``**`` or ``pow()``, ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``)
266+
and the comparisons (``==``, ``<``, ``>``, ``<=``, ``>=``, ``!=``) is
267+
equivalent to the corresponding universal function (or :term:`ufunc` for short)
268+
in DPNP. For more information, see the section on :ref:`Universal Functions
251269
<ufuncs>`.
252270

253271

0 commit comments

Comments
 (0)