# numpydoc Sphinx extension that provides support for the Numpy docstring format in Sphinx. - **Documentation**: [https://numpydoc.readthedocs.io/](https://numpydoc.readthedocs.io/) - **Source Code**: [https://github.com/numpy/numpydoc](https://github.com/numpy/numpydoc) ## Example ```{raw} html
Docstring for the example.py module.
Modules names should have short, all-lowercase names. The module name may have underscores if this improves readability.
Every module should have a docstring at the very top of the file. The module’s docstring may extend over multiple lines. If your docstring does extend over multiple lines, the closing three quotation marks must be on a line by itself, preferably preceded by a blank line.
Summarize the function in one line.
Several sentences providing an extended description. Refer to variables using back-ticks, e.g. var.
Array_like means all those objects – lists, nested lists, etc. – that can be converted to an array. We can also refer to variables like var1.
intThe type above can either refer to an actual Python type
(e.g. int), or describe the type of the variable in more
detail, e.g. (N,) ndarray or array_like.
Other arguments.
Choices in brackets, default first when optional.
typeExplanation of anonymous return value of type type.
typeExplanation of return value named describe.
typeExplanation of out.
int, optionalInfrequently used parameters can be described under this optional section to prevent cluttering the Parameters section.
dictOther infrequently used keyword arguments. Note that all keyword arguments appearing after the first parameter specified under the Other Parameters section, should also be described under this section.
Because you shouldn’t have done that.
See also
numpy.arrayRelationship (optional).
numpy.ndarrayRelationship (optional), which could be fairly long, in which case the line wraps here.
numpy.dot, numpy.linalg.norm, numpy.eyeReferences
Cite the relevant literature, e.g. [1]. You may also cite these references in the notes section above.
O. McNoleg, “The integration of GIS, remote sensing, expert systems and adaptive co-kriging for environmental habitat modelling of the Highland Haggis using object-oriented, fuzzy-logic and neural-network techniques,” Computers & Geosciences, vol. 22, pp. 585-588, 1996.
Examples
These are written in doctest format, and should illustrate how to use the function.
>>> a = [1, 2, 3]
>>> print([x + 3 for x in a])
[4, 5, 6]
>>> print("a\nb")
a
b