我最近研究了如何在 Jupyter Notebook
的 cell
中查找任何内置 python 库
函数的文档。对我如何访问文档有什么建议吗?我知道键盘快捷键是 shift + tab
,使用 4 次 shift + tab
,会弹出带有示例的整个文档。我只是想知道通常的方式,除了捷径。
最佳答案
文档来自Python代码中的docstring。
调用help可以看到, __doc__
属性返回字符串。
以内置的filter
为例:
# Displays the documentation for filter function
help(filter)
# Obtains the string of the documentation.
docstring = filter.__doc__
关于python - 如何在 Jupyter Notebook 上查看内置函数的文档?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47642683/