summaryrefslogtreecommitdiff
path: root/numpy/doc/structured_arrays.py
diff options
context:
space:
mode:
authorAllan Haldane <allan.haldane@gmail.com>2018-12-15 11:46:22 -0500
committerAllan Haldane <allan.haldane@gmail.com>2018-12-15 11:47:03 -0500
commit2981ed622501ac48c54c4efdf06a84084b70ff66 (patch)
tree2f4cea4c0abdcb1704d56d7746232138af057e81 /numpy/doc/structured_arrays.py
parente26c2990c4828d6f7f2f588d75cd01eecafd53f3 (diff)
downloadnumpy-2981ed622501ac48c54c4efdf06a84084b70ff66.tar.gz
DOC: more doc updates for structured arrays
[ci skip]
Diffstat (limited to 'numpy/doc/structured_arrays.py')
-rw-r--r--numpy/doc/structured_arrays.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/doc/structured_arrays.py b/numpy/doc/structured_arrays.py
index 0fcdecf00..e92a06124 100644
--- a/numpy/doc/structured_arrays.py
+++ b/numpy/doc/structured_arrays.py
@@ -397,6 +397,15 @@ typically a non-structured array, except in the case of nested structures.
>>> y.dtype, y.shape, y.strides
(dtype('float32'), (2,), (12,))
+If the accessed field is a subarray, the dimensions of the subarray
+are appended to the shape of the result::
+
+ >>> x = np.zeros((2,2), dtype=[('a', np.int32), ('b', np.float64, (3,3))])
+ >>> x['a'].shape
+ (2, 2)
+ >>> x['b'].shape
+ (2, 2, 3, 3)
+
Accessing Multiple Fields
```````````````````````````