For example, I want to check the source code of a python library, directly in the notebook, is there a way to do that?
Thank you
Type the fully qualified function name, then type ??.
numpy.random.rand gives me the docstring! what do you mean exactly by a full qualified function name? Trying cv2.resize?? also doesn't work. Could the reason be that these function are not actually written in pure Python?sklearn.metrics.classification_report?? .. then what to do?from sklearn.metrics import classification_report and then classification_report?? + Shift EnterYou can use inspect module (which is built in) - for example you can see the tree module below from scikit-learn.
import inspect
from sklearn import tree
inspect.getsourcelines(tree.tree)
inspect.getsource(tree.tree) would print it like a file.