summaryrefslogtreecommitdiff
path: root/doc/source/user
diff options
context:
space:
mode:
authorA Chethan Reddy <69640722+chethanreddy123@users.noreply.github.com>2023-01-16 23:35:12 +0530
committerGitHub <noreply@github.com>2023-01-16 19:05:12 +0100
commit1c93bd674aa6e8f6527a33a32b30eb39c82692f0 (patch)
treedf8294795600a96a6ad7019fc437f2cd98033109 /doc/source/user
parent6b5cd92675139511b4b24ddfe822e96b03700edb (diff)
downloadnumpy-1c93bd674aa6e8f6527a33a32b30eb39c82692f0.tar.gz
DOC: Structured array doc update to note `dtype[name]` (#22723)
Add note that name access of structured dtypes is allowed. Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Diffstat (limited to 'doc/source/user')
-rw-r--r--doc/source/user/basics.rec.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/source/user/basics.rec.rst b/doc/source/user/basics.rec.rst
index b56b4d177..640cfaa8b 100644
--- a/doc/source/user/basics.rec.rst
+++ b/doc/source/user/basics.rec.rst
@@ -166,6 +166,11 @@ attribute of the dtype object::
>>> d.names
('x', 'y')
+The dtype of each individual field can be looked up by name::
+
+ >>> d['x']
+ dtype('int64')
+
The field names may be modified by assigning to the ``names`` attribute using a
sequence of strings of the same length.