gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-30 01:05:06 25 4
gpt4 key购买 nike

我最近研究了如何在 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com