python - 如何在 Jupyter Notebook 上查看内置函数的文档?

标签 python jupyter-notebook ipython-notebook

我最近研究了如何在 Jupyter Notebookcell 中查找任何内置 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/

相关文章:

python - Python 上的 Google 应用引擎 "ImportError: No module named google.appengine.ext"

python - 在 if-elif-else 语句中定义值时打印小计?名称错误问题[Python 2.7]

jupyter-notebook - 在 Jupyter Notebooks 中,工具提示功能(shift + tab)适用于某些内核(例如 Python 3),但不适用于其他内核(例如 Scala、Groovy)。这是预期的吗?

python - Intellij idea 无法正确运行 IPython notebook

python - 没有名为 traitlets.config.application 的模块

python - Tensorflow .pb 文件到 coreml 模型 : 'Unsupported Ops of type: AddV2'

python - 如何使用 Python 在 cPanel 中连接数据库?

python - 使用 nbformat 生成 Jupyter 笔记本 - Altair 图表不显示

javascript - ipython %%javascript 魔术输出到单元格和控制台

ipython - 如何检测是否正在运行 ipython qtconsole?