numpy.info#
- numpy.info(object=None,maxwidth=76,output=None,toplevel='numpy')[source]#
Get help information for an array, function, class, or module.
- Parameters:
- objectobject or str, optional
Input object or name to get information about. Ifobject isan
ndarrayinstance, information about the array is printed.Ifobject is a numpy object, its docstring is given. If it isa string, available modules are searched for matching objects.If None, information aboutinfoitself is returned.- maxwidthint, optional
Printing width.
- outputfile like object, optional
File like object that the output is written to, default is
None, in which casesys.stdoutwill be used.The object has to be opened in ‘w’ or ‘a’ mode.- toplevelstr, optional
Start search at this level.
Notes
When used interactively with an object,
np.info(obj)is equivalenttohelp(obj)on the Python prompt orobj?on the IPythonprompt.Examples
>>>np.info(np.polyval) polyval(p, x) Evaluate the polynomial p at x. ...
When using a string forobject it is possible to get multiple results.
>>>np.info('fft') *** Found in numpy ***Core FFT routines... *** Found in numpy.fft *** fft(a, n=None, axis=-1)... *** 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: ndarrayshape: (2, 3)strides: (24, 8)itemsize: 8aligned: Truecontiguous: Truefortran: Falsedata pointer: 0x562b6e0d2860 # may varybyteorder: littlebyteswap: Falsetype: complex64