From f480d6ed70aa12bada2b8c6594983a2c0366400c Mon Sep 17 00:00:00 2001 From: kritisingh1 Date: Tue, 4 Jun 2019 01:43:31 +0530 Subject: [PATCH] DOC: Adds documentation for numpy.dtype.base --- numpy/core/_add_newdocs.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/numpy/core/_add_newdocs.py b/numpy/core/_add_newdocs.py index bdff64b20ab5..f0e952acffd8 100644 --- a/numpy/core/_add_newdocs.py +++ b/numpy/core/_add_newdocs.py @@ -5621,6 +5621,41 @@ 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',