Issue
I am using jupyter notebook. I have 3 jupyter source files written in python in a folder in the same directory: parser, preprocess, and temp. I am trying to import parser and import preprocess in the temp file so that I can use the methods written in those files. Example: there is method named extract in parser file. I want to use that from temp file. How can I do that?
Solution
The easiest way is to change the files you need to import as py files. As an example, parser.ipynb can be converted to a python file parser.py, and you can import it from another notebook file. If you want to use a function named extract() from parser.py, just import
from parser import extract
Answered By - batman
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.