diff options
author | Allan Haldane <allan.haldane@gmail.com> | 2015-01-16 23:53:41 -0500 |
---|---|---|
committer | Allan Haldane <allan.haldane@gmail.com> | 2015-01-22 17:36:43 -0500 |
commit | 1bd0b4e8f176cd80e81b5f50832db5f8ba1ee1e9 (patch) | |
tree | fce876400e049c7927cfe4b62ee4d1ca00a8ed7b /doc/source/reference/c-api.array.rst | |
parent | b69035e8ea28bd759b929822aaba544d3c5f8c30 (diff) | |
download | numpy-1bd0b4e8f176cd80e81b5f50832db5f8ba1ee1e9.tar.gz |
DOC: improve record/structured array nomenclature & guide
This update adds a section better describing record arrays in the user
guide (numpy/doc/structured_arrays.py).
It also corrects nomenclature, such that "structured array" refers to
ndarrays with structured dtype, "record array" refers to modified
ndarrays as created by np.rec.array, and "recarray" refers to ndarrays
viewed as np.recarray. See the note at the end of the structured
array user guide.
Diffstat (limited to 'doc/source/reference/c-api.array.rst')
-rw-r--r-- | doc/source/reference/c-api.array.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/source/reference/c-api.array.rst b/doc/source/reference/c-api.array.rst index 08eba243e..9b8cc04b6 100644 --- a/doc/source/reference/c-api.array.rst +++ b/doc/source/reference/c-api.array.rst @@ -1240,9 +1240,9 @@ Special functions for NPY_OBJECT A function to INCREF all the objects at the location *ptr* according to the data-type *dtype*. If *ptr* is the start of a - record with an object at any offset, then this will (recursively) + structured type with an object at any offset, then this will (recursively) increment the reference count of all object-like items in the - record. + structured type. .. cfunction:: int PyArray_XDECREF(PyArrayObject* op) @@ -1253,7 +1253,7 @@ Special functions for NPY_OBJECT .. cfunction:: void PyArray_Item_XDECREF(char* ptr, PyArray_Descr* dtype) - A function to XDECREF all the object-like items at the loacation + A function to XDECREF all the object-like items at the location *ptr* as recorded in the data-type, *dtype*. This works recursively so that if ``dtype`` itself has fields with data-types that contain object-like items, all the object-like fields will be @@ -1540,7 +1540,7 @@ Conversion itemsize of the new array type must be less than *self* ->descr->elsize or an error is raised. The same shape and strides as the original array are used. Therefore, this function has the - effect of returning a field from a record array. But, it can also + effect of returning a field from a structured array. But, it can also be used to select specific bytes or groups of bytes from any array type. @@ -1786,7 +1786,7 @@ Item selection and manipulation ->descr is a data-type with fields defined, then self->descr->names is used to determine the sort order. A comparison where the first field is equal will use the second - field and so on. To alter the sort order of a record array, create + field and so on. To alter the sort order of a structured array, create a new data-type with a different order of names and construct a view of the array with that new data-type. @@ -1805,7 +1805,7 @@ Item selection and manipulation to understand the order the *sort_keys* must be in (reversed from the order you would use when comparing two elements). - If these arrays are all collected in a record array, then + If these arrays are all collected in a structured array, then :cfunc:`PyArray_Sort` (...) can also be used to sort the array directly. @@ -1838,7 +1838,7 @@ Item selection and manipulation If *self*->descr is a data-type with fields defined, then self->descr->names is used to determine the sort order. A comparison where the first field is equal will use the second field and so on. To alter the - sort order of a record array, create a new data-type with a different + sort order of a structured array, create a new data-type with a different order of names and construct a view of the array with that new data-type. Returns zero on success and -1 on failure. |