From 2981ed622501ac48c54c4efdf06a84084b70ff66 Mon Sep 17 00:00:00 2001 From: Allan Haldane Date: Sat, 15 Dec 2018 11:46:22 -0500 Subject: DOC: more doc updates for structured arrays [ci skip] --- numpy/doc/structured_arrays.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'numpy/doc/structured_arrays.py') 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 ``````````````````````````` -- cgit v1.2.1