summaryrefslogtreecommitdiff
path: root/numpy/lib/utils.py
diff options
context:
space:
mode:
authorwarren <warren.weckesser@gmail.com>2023-03-07 09:36:37 -0500
committerwarren <warren.weckesser@gmail.com>2023-03-07 09:36:46 -0500
commitd559513a682ae91a85d823b414df7588c04b1e5a (patch)
tree019a281660f249f154ad3ef3e753dec6940f160c /numpy/lib/utils.py
parente82af22dd1d7c01329b640f1fb6cdee6b1169898 (diff)
downloadnumpy-d559513a682ae91a85d823b414df7588c04b1e5a.tar.gz
DOC: Document that info() handles array instances.
[skip actions] [skip travis] [skip azp] [skip cirrus]
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r--numpy/lib/utils.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index 8d2d2fe33..5d5770c71 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -533,10 +533,11 @@ def info(object=None, maxwidth=76, output=None, toplevel='numpy'):
Parameters
----------
object : object or str, optional
- Input object or name to get information about. If `object` is a
- numpy object, its docstring is given. If it is a string, available
- modules are searched for matching objects. If None, information
- about `info` itself is returned.
+ Input object or name to get information about. If `object` is
+ an `ndarray` instance, information about the array is printed.
+ If `object` is a numpy object, its docstring is given. If it is
+ a string, available modules are searched for matching objects.
+ If None, information about `info` itself is returned.
maxwidth : int, optional
Printing width.
output : file like object, optional
@@ -575,6 +576,22 @@ def info(object=None, maxwidth=76, output=None, toplevel='numpy'):
*** Repeat reference found in numpy.fft.fftpack ***
*** Total of 3 references found. ***
+ When the argument is an array, information about the array is printed.
+
+ >>> a = np.array([[1 + 2j, 3, -4], [-5j, 6, 0]], dtype=np.complex64)
+ >>> np.info(a)
+ class: ndarray
+ shape: (2, 3)
+ strides: (24, 8)
+ itemsize: 8
+ aligned: True
+ contiguous: True
+ fortran: False
+ data pointer: 0x562b6e0d2860
+ byteorder: little
+ byteswap: False
+ type: complex64
+
"""
global _namedict, _dictlist
# Local import to speed up numpy's import time.