[英]How can I check source code of a module in Jupyter notebook?
例如,我想直接在筆記本中查看python庫的源代碼,有沒有辦法做到這一點?
謝謝
輸入完全限定的函數名稱,然后鍵入??
。
您可以使用inspect模塊(內置) - 例如,您可以從scikit-learn中看到下面的樹模塊。
import inspect
from sklearn import tree
inspect.getsourcelines(tree.tree)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.