在哪里可以找到 numpy 百分位数的源代码



在哪里可以找到numpypercentile函数背后的源代码?我想检查一下。我已经在谷歌上搜索过了,但还没有找到任何东西。

要在自己的系统上找到它,请尝试inspect:

import inspect
from numpy import percentile
inspect.getfile(percentile)

numpy的源代码在Github中,百分位函数可以在lib/function_base.py 的第3076行找到

使用ipython,您可以通过在函数后面加??(两个问号)来查看源代码

from numpy import percentile
percentile??

numpy 中的source函数

from numpy import percentile, source
print source(percentile)

将输出源代码。

最新更新