diff options
Diffstat (limited to 'doc/source/reference')
-rw-r--r-- | doc/source/reference/arrays.indexing.rst | 4 | ||||
-rw-r--r-- | doc/source/reference/arrays.ndarray.rst | 8 | ||||
-rw-r--r-- | doc/source/reference/arrays.scalars.rst | 15 | ||||
-rw-r--r-- | doc/source/reference/c-api.array.rst | 8 | ||||
-rw-r--r-- | doc/source/reference/maskedarray.baseclass.rst | 2 |
5 files changed, 17 insertions, 20 deletions
diff --git a/doc/source/reference/arrays.indexing.rst b/doc/source/reference/arrays.indexing.rst index b7bc3a655..6a5f428da 100644 --- a/doc/source/reference/arrays.indexing.rst +++ b/doc/source/reference/arrays.indexing.rst @@ -36,8 +36,8 @@ objects, the :const:`Ellipsis` object, or the :const:`newaxis` object, but not for integer arrays or other embedded sequences. .. index:: - triple: ndarray; special methods; getslice - triple: ndarray; special methods; setslice + triple: ndarray; special methods; getitem + triple: ndarray; special methods; setitem single: ellipsis single: newaxis diff --git a/doc/source/reference/arrays.ndarray.rst b/doc/source/reference/arrays.ndarray.rst index 14d35271e..4c8bbf66d 100644 --- a/doc/source/reference/arrays.ndarray.rst +++ b/doc/source/reference/arrays.ndarray.rst @@ -119,12 +119,12 @@ strided scheme, and correspond to memory that can be *addressed* by the strides: .. math:: - s_k^{\mathrm{column}} = \prod_{j=0}^{k-1} d_j , - \quad s_k^{\mathrm{row}} = \prod_{j=k+1}^{N-1} d_j . + s_k^{\mathrm{column}} = \mathrm{itemsize} \prod_{j=0}^{k-1} d_j , + \quad s_k^{\mathrm{row}} = \mathrm{itemsize} \prod_{j=k+1}^{N-1} d_j . .. index:: single-segment, contiguous, non-contiguous -where :math:`d_j` `= self.itemsize * self.shape[j]`. +where :math:`d_j` `= self.shape[j]`. Both the C and Fortran orders are :term:`contiguous`, *i.e.,* :term:`single-segment`, memory layouts, in which every part of the @@ -595,8 +595,6 @@ Container customization: (see :ref:`Indexing <arrays.indexing>`) ndarray.__len__ ndarray.__getitem__ ndarray.__setitem__ - ndarray.__getslice__ - ndarray.__setslice__ ndarray.__contains__ Conversion; the operations :func:`complex()`, :func:`int()`, diff --git a/doc/source/reference/arrays.scalars.rst b/doc/source/reference/arrays.scalars.rst index 4acaf1b3b..f76087ce2 100644 --- a/doc/source/reference/arrays.scalars.rst +++ b/doc/source/reference/arrays.scalars.rst @@ -248,7 +248,8 @@ Indexing Array scalars can be indexed like 0-dimensional arrays: if *x* is an array scalar, -- ``x[()]`` returns a 0-dimensional :class:`ndarray` +- ``x[()]`` returns a copy of array scalar +- ``x[...]`` returns a 0-dimensional :class:`ndarray` - ``x['field-name']`` returns the array scalar in the field *field-name*. (*x* can have fields, for example, when it corresponds to a structured data type.) @@ -282,10 +283,10 @@ Defining new types ================== There are two ways to effectively define a new array scalar type -(apart from composing structured types :ref:`dtypes <arrays.dtypes>` from -the built-in scalar types): One way is to simply subclass the -:class:`ndarray` and overwrite the methods of interest. This will work to -a degree, but internally certain behaviors are fixed by the data type of -the array. To fully customize the data type of an array you need to -define a new data-type, and register it with NumPy. Such new types can only +(apart from composing structured types :ref:`dtypes <arrays.dtypes>` from +the built-in scalar types): One way is to simply subclass the +:class:`ndarray` and overwrite the methods of interest. This will work to +a degree, but internally certain behaviors are fixed by the data type of +the array. To fully customize the data type of an array you need to +define a new data-type, and register it with NumPy. Such new types can only be defined in C, using the :ref:`NumPy C-API <c-api>`. diff --git a/doc/source/reference/c-api.array.rst b/doc/source/reference/c-api.array.rst index 3574282a4..2a7bb3a32 100644 --- a/doc/source/reference/c-api.array.rst +++ b/doc/source/reference/c-api.array.rst @@ -1686,12 +1686,12 @@ Shape Manipulation different total number of elements then the old shape. If reallocation is necessary, then *self* must own its data, have *self* - ``>base==NULL``, have *self* - ``>weakrefs==NULL``, and - (unless refcheck is 0) not be referenced by any other array. A - reference to the new array is returned. The fortran argument can - be :c:data:`NPY_ANYORDER`, :c:data:`NPY_CORDER`, or - :c:data:`NPY_FORTRANORDER`. It currently has no effect. Eventually + (unless refcheck is 0) not be referenced by any other array. + The fortran argument can be :c:data:`NPY_ANYORDER`, :c:data:`NPY_CORDER`, + or :c:data:`NPY_FORTRANORDER`. It currently has no effect. Eventually it could be used to determine how the resize operation should view the data when constructing a differently-dimensioned array. + Returns None on success and NULL on error. .. c:function:: PyObject* PyArray_Transpose(PyArrayObject* self, PyArray_Dims* permute) diff --git a/doc/source/reference/maskedarray.baseclass.rst b/doc/source/reference/maskedarray.baseclass.rst index a1c90a45d..f35b0ea88 100644 --- a/doc/source/reference/maskedarray.baseclass.rst +++ b/doc/source/reference/maskedarray.baseclass.rst @@ -417,8 +417,6 @@ Container customization: (see :ref:`Indexing <arrays.indexing>`) MaskedArray.__getitem__ MaskedArray.__setitem__ MaskedArray.__delitem__ - MaskedArray.__getslice__ - MaskedArray.__setslice__ MaskedArray.__contains__ |