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

use*_*361 8 python numpy

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

小智 13

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

import inspect
from numpy import percentile
inspect.getfile(percentile)
Run Code Online (Sandbox Code Playgroud)

  • 打印源:`print(inspect.getsource(numpy.percentile))` (3认同)

Ham*_*tti 8

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


Ed *_*ith 5

随着ipython您可以通过将查看源代码??(两个问号)功能后,

from numpy import percentile

percentile??
Run Code Online (Sandbox Code Playgroud)