numpy.info#
- numpy.info(object=None, maxwidth=76, output=None, toplevel='numpy')[source]#
取得陣列、函數、類別或模組的說明資訊。
- 參數:
註解
當與物件互動式使用時,
np.info(obj)
等同於 Python 提示字元上的help(obj)
或 IPython 提示字元上的obj?
。範例
>>> np.info(np.polyval) polyval(p, x) Evaluate the polynomial p at x. ...
當對 object 使用字串時,可能會獲得多個結果。
>>> 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. ***
當引數為陣列時,關於陣列的資訊會被列印。
>>> 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 # may vary byteorder: little byteswap: False type: complex64