summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2019-06-07 09:45:05 +0300
committerGitHub <noreply@github.com>2019-06-07 09:45:05 +0300
commitf195b6d05d36889528927c9035a367fde5a21bc7 (patch)
treea84f1028d8478ca3ef335675010dcb2fb048a349 /numpy
parentbc66801a9e578efb73c73473ee7a99748c3214f1 (diff)
parentf480d6ed70aa12bada2b8c6594983a2c0366400c (diff)
downloadnumpy-f195b6d05d36889528927c9035a367fde5a21bc7.tar.gz
Merge pull request #13703 from kritisingh1/base
DOC: Adds documentation for numpy.dtype.base
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/_add_newdocs.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/numpy/core/_add_newdocs.py b/numpy/core/_add_newdocs.py
index 78bd882f1..9f2b67a6b 100644
--- a/numpy/core/_add_newdocs.py
+++ b/numpy/core/_add_newdocs.py
@@ -5632,6 +5632,41 @@ add_newdoc('numpy.core.multiarray', 'dtype', ('subdtype',
then the extra dimensions implied by *shape* are tacked on to
the end of the retrieved array.
+ See Also
+ --------
+ dtype.base
+
+ Examples
+ --------
+ >>> x = numpy.dtype('8f')
+ >>> x.subdtype
+ (dtype('float32'), (8,))
+
+ >>> x = numpy.dtype('i2')
+ >>> x.subdtype
+ >>>
+
+ """))
+
+add_newdoc('numpy.core.multiarray', 'dtype', ('base',
+ """
+ Returns dtype for the base element of the subarrays,
+ regardless of their dimension or shape.
+
+ See Also
+ --------
+ dtype.subdtype
+
+ Examples
+ --------
+ >>> x = numpy.dtype('8f')
+ >>> x.base
+ dtype('float32')
+
+ >>> x = numpy.dtype('i2')
+ >>> x.base
+ dtype('int16')
+
"""))
add_newdoc('numpy.core.multiarray', 'dtype', ('type',