Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.source

numpy.source(object,output=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='US-ASCII'>)[source]

Print or write to a file the source code for a NumPy object.

The source code is only returned for objects written in Python. Manyfunctions and classes are defined in C and will therefore not returnuseful information.

Parameters:
object:numpy object

Input object. This can be any object (function, class, module,…).

output:file object, optional

Ifoutput not supplied then source code is printed to screen(sys.stdout). File object must be created with either write ‘w’ orappend ‘a’ modes.

See also

lookfor,info

Examples

>>>np.source(np.interp)In file: /usr/lib/python2.6/dist-packages/numpy/lib/function_base.pydef interp(x, xp, fp, left=None, right=None):    """.... (full docstring printed)"""    if isinstance(x, (float, int, number)):        return compiled_interp([x], xp, fp, left, right).item()    else:        return compiled_interp(x, xp, fp, left, right)

The source code is only returned for objects written in Python.

>>>np.source(np.array)Not available for this object.

Previous topic

numpy.info

Next topic

Indexing routines

Quick search

  • © Copyright 2008-2018, The SciPy community.
  • Last updated on Jul 24, 2018.
  • Created usingSphinx 1.6.6.

[8]ページ先頭

©2009-2025 Movatter.jp