About importing on Jupiter notebook

Asked 3 months ago, Updated 3 months ago, 7 views

I made a file called reader on Jupiter notebook.
I want to import it as shown in the image below, but I get an error
Also, the saved one comes with .ipynb. What does this mean?
I would appreciate it if you could reply.
Enter a description of the image here

python jupyter-notebook

2022-09-30 11:22

1 Answers

.ipynb is the jupyter notebook saved file format.If you open the contents with an editor (such as atom), you will find that this is a json format of the contents of the notebook, not a python script.

If you have any code you want to use from the notebook, you need to save it as a normal program in .py format and import it on the notebook.
(As far as I remember, if I didn't write a code like a charm, I wouldn't have been able to import the local file on the notebook, but I was able to import it without any problems, so I might have misremembered it.)

Addition @July 16, 2017

To extract and save only the python code portion from the contents of the notebook, it appears that you can retrieve File->Download as->python (.py) from the target notebook open.

2022-09-30 11:22

If you have any answers or tips

© 2023 OneMinuteCode. All rights reserved.