I was trying to import functions from one notebook file to another in the most simplest way:
As you can see the files are in the same folder but I still get this error. Does anybody know how to resolve this?
CodePudding user response:
You might try using the %run
magic command.
You could store your functions in a sort of library notebook and use the following line to import them in your current notebook:
%run ./func_library_notebook.ipynb
CodePudding user response:
For example, import funb()
located in b.ipynb
in a.ipynb
.
install module:
pip install ipynb
in
a.ipynb
:import ipynb from ipynb.fs.full.b import funb // ipynb.fs.full.<notebook_name> funb()
See result: