summaryrefslogtreecommitdiff
path: root/numpy/add_newdocs.py
diff options
context:
space:
mode:
authorAllan Haldane <allan.haldane@gmail.com>2015-01-16 23:53:41 -0500
committerAllan Haldane <allan.haldane@gmail.com>2015-01-22 17:36:43 -0500
commit1bd0b4e8f176cd80e81b5f50832db5f8ba1ee1e9 (patch)
treefce876400e049c7927cfe4b62ee4d1ca00a8ed7b /numpy/add_newdocs.py
parentb69035e8ea28bd759b929822aaba544d3c5f8c30 (diff)
downloadnumpy-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 'numpy/add_newdocs.py')
-rw-r--r--numpy/add_newdocs.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py
index 73efdb6a9..66b889cc9 100644
--- a/numpy/add_newdocs.py
+++ b/numpy/add_newdocs.py
@@ -4629,7 +4629,7 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('view',
>>> print x
[(1, 20) (3, 4)]
- Using a view to convert an array to a record array:
+ Using a view to convert an array to a recarray:
>>> z = x.view(np.recarray)
>>> z.a
@@ -5875,17 +5875,18 @@ add_newdoc('numpy.core.multiarray', 'dtype',
>>> np.dtype(np.int16)
dtype('int16')
- Record, one field name 'f1', containing int16:
+ Structured type, one field name 'f1', containing int16:
>>> np.dtype([('f1', np.int16)])
dtype([('f1', '<i2')])
- Record, one field named 'f1', in itself containing a record with one field:
+ Structured type, one field named 'f1', in itself containing a structured
+ type with one field:
>>> np.dtype([('f1', [('f1', np.int16)])])
dtype([('f1', [('f1', '<i2')])])
- Record, two fields: the first field contains an unsigned int, the
+ Structured type, two fields: the first field contains an unsigned int, the
second an int32:
>>> np.dtype([('f1', np.uint), ('f2', np.int32)])