diff options
author | Pierre de Buyl <pdebuyl@pdebuyl.be> | 2021-11-03 15:24:44 +0100 |
---|---|---|
committer | Pierre de Buyl <pdebuyl@pdebuyl.be> | 2021-12-08 15:29:33 +0100 |
commit | 2525741592afd597572935402355e9d81dac86bd (patch) | |
tree | 0c5441cd6ebc6f51fc871e3edaf1ebfc7df276b5 /doc/source/reference/arrays.ndarray.rst | |
parent | ce4555cbfc216a72c19e7369fe3353806bb89b67 (diff) | |
download | numpy-2525741592afd597572935402355e9d81dac86bd.tar.gz |
[DOC] make some doctests in user,reference pass pytest
1. Add `import numpy as np` in rst files
2. Update NumPy repr for array (whitespace)
3. Update bytearray representation
4. Fix tiny output formatting (`<class ...>`, etc)
5. Format tracebacks
6. Skip random number tests or some platform-dependent outputs
7. Add `<matplotlib. ... at 0x...>` or similar output lines where
missing
8. Set seed
Diffstat (limited to 'doc/source/reference/arrays.ndarray.rst')
-rw-r--r-- | doc/source/reference/arrays.ndarray.rst | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/source/reference/arrays.ndarray.rst b/doc/source/reference/arrays.ndarray.rst index 0f703b475..889fb103c 100644 --- a/doc/source/reference/arrays.ndarray.rst +++ b/doc/source/reference/arrays.ndarray.rst @@ -1,5 +1,8 @@ .. currentmodule:: numpy +.. for doctest: + >>> import numpy as np + .. _arrays.ndarray: ****************************************** @@ -54,13 +57,13 @@ objects implementing the :class:`buffer` or :ref:`array >>> y = x[:,1] >>> y - array([2, 5]) + array([2, 5], dtype=int32) >>> y[0] = 9 # this also changes the corresponding element in x >>> y - array([9, 5]) + array([9, 5], dtype=int32) >>> x array([[1, 9, 3], - [4, 5, 6]]) + [4, 5, 6]], dtype=int32) Constructing arrays |