在 jupyter notebook 中,我们会经常遇到修改模组后重新加载的情况,如果直接再次运行 import 语句,默认不会刷新原来的模组。
通过在 jupyter notebook 中加入两行语句,就可以实现自动地重新加载所需的模组:
%load_ext autoreload
%autoreload 2
在 jupyter notebook 中,我们会经常遇到修改模组后重新加载的情况,如果直接再次运行 import 语句,默认不会刷新原来的模组。
通过在 jupyter notebook 中加入两行语句,就可以实现自动地重新加载所需的模组:
%load_ext autoreload
%autoreload 2