1

I am trying to import a function from an existing Jupyter notebook to a new notebook. Both the notebooks are saved in a virtual environment that I have been working on. The command that I am trying to execute in the new notebook is as follows:

from Probability.ipynb import norm_cdf

Probability = old notebook

norm_cdf = function name

I am getting the error below:


ModuleNotFoundError                         Traceback (most recent call last)

<ipython-input-4-9659a841148e> in <module>
----> 1 from Probability.ipynb import norm_cdf

ModuleNotFoundError: No module named 'Probability'

Thanks in advance for your help!

雷笑东
  • 49
  • 1
  • 10
  • 1
    Does this answer your question? [import a function from another .ipynb file](https://stackoverflow.com/questions/44116194/import-a-function-from-another-ipynb-file) – rajatgoyal715 Jul 02 '20 at 06:01

1 Answers1

4

If I understand your question correctly you should use the tools provided by ipynb package/module importer. You can then import the function like this.

from ipynb.fs.full.Probability import norm_cdf

Hope this helps, best wishes.

Mr. ReLu
  • 93
  • 8