In [5]: import numpy as np In [6]: data = {i : np.random.randn() for i in range(7)} In [7]: data Out[7]: {0: -0.20470765948471295, 1: 0.47894333805754824, 2: -0.5194387150567381, 3: -0.55573030434749, 4: 1.9657805725027142, 5: 1.3934058329729904, 6: 0.09290787674371767}
Prints the values to a stream, or to sys.stdout by default. Optional keyword arguments: file: a file-like object (stream); defaults to the current sys.stdout. sep: string inserted between values, default a space. end: string appended after the last value, default a newline. flush: whether to forcibly flush the stream. Type: builtin_function_or_method
1 2 3 4 5 6 7 8
def add_numbers(a, b): """ Add two numbers together Returns ------- the_sum : type of arguments """ return a + b
In [11]: add_numbers? Signature: add_numbers(a, b) Docstring: Add two numbers together
Returns ------- the_sum : type of arguments File: <ipython-input-9-6a548a216e27> Type: function
使⽤用??会显示函数的源码:
In [12]: add_numbers?? Signature: add_numbers(a, b) Source: def add_numbers(a, b): """ Add two numbers together Returns ------- the_sum : type of arguments """ return a + b File: <ipython-input-9-6a548a216e27> Type: function
搜索IPython的命名空间
1 2 3 4 5 6
In [13]: np.*load*? np.__loader__ np.load np.loads np.loadtxt np.pkgload