I have got downloaded a file that got downloaded in a format .ipynb extension but its not in a readable format. Can anyone help me to figure out how to make it in a readable format? Attaching a screenshot of the file when I tried opening it in notepad.
-
A jupyter notebook needs to be opened using jupyter, not just a text editor. See: https://jupyter.org/ – Ari Cooper-Davis Feb 11 '22 at 13:34
-
Does this answer your question? [What is the difference between a .py file and .ipynb file?](https://stackoverflow.com/questions/57502484/what-is-the-difference-between-a-py-file-and-ipynb-file) – Ari Cooper-Davis Feb 11 '22 at 13:35
2 Answers
One of the easiest ways to just view a notebook file that is also 100% secure in case what you are being sent is sensitive: nbpreview.
When you go there it asks you to choose a local file. The file isn't uploaded anywhere. It remains in your browser's local cache so it is useful for sensitive stuff that cannot be public.
Similarly, you can upload it to the notebook{sharing}space which is billed as "the fastest way to share your notebooks". It would provide you with a link to view the notebook you have and can be private if you limit sharing the link.
If the notebook can be posted to Github (repository or gist) or online, you can point nbviewer at it and have it rendered nicely. In fact, although it is technically 'static', nbviewer can render some interactive Plotly plots and widget controls that enable playing back animations comprised of frames. This rendering form is also very nice for sharing with non-programmers as the GitHub cruft is not surrounding the content.
You can use Jupyter running in your browser and backed by a free Jupyter community-run service to view the notebook file as an active notebook, on what is equivalent to a temporary remote machine.
Go to Try Jupyter and select either 'JupyterLab' or 'Jupyter Notebook' from the offerings presented. I'd suggest JupyterLab as the steps outline below are made easier as you have the file navigation pane on the left.
After your session spins up in your browser, if you chose JupyterLab, drag your file from your local machine into the file navigation pane on the left side. It will get a gray dashed line around it when you have dragged it to the right place. Drop it in and let it upload. Now double click on it to open it.
If you don't want to drag-and-drop or you chose Jupyter notebooks (classic notebook interface) make a text file and paste in the content you showed. (It's json format as that is the underlying .ipynb
format presently.) Save that file with an .ipynb
extension. You should then be able to open it the Jupyter Dashboard. (Note the following in the rest of this section was written before the 'Try Jupyter' offerings were switched to using the experimental JupyterLite and so your mileage may vary. If you drag-and-drop into JupyterLite, it actually is in your machine; however, it is in a virtual system in your browser that your local file system cannot access directly. (JupyterLite, powered by Web Assembly (WASM) and running inside your local browser is definitely an easy option if you are just looking to view the notebook, or at least most of it since it may have trouble with fancy widgets & offerings that need pure active Python, and not have anything leave your own machine.) To get what this section was specifically written for now, go here and click on the launch binder
badge to trigger a session on a true remote machine served by MyBinder.) You used to click on the logo in the upper left to get to the dashboard but it will now take you to JupyterLab and you can double click to open your notebook file. If you really need the classic dashboard, change the end of the URL to change /lab
to /tree
.
Note because the environment backing your notebook hasn't been set up to handle everything, you'll be out of luck for now trying to run it. You'd have to add your pokemon.csv
and install anything else besides pandas. There are ways to use the MyBinder system to handle that as well; however, probably best learned about later this stage.
The MyBinder session is temporary and unique to you. It will close after 10 minutes of inactivity and no longer be accessible. You can always open another session later and redo the steps. Or learn about other options eventually.
Related:
Nbpreview and a lot of the related tools mentioned here are also covered in Sharing R code in Jupyter notebooks.
(These following suggestions mostly assume the notebook is already online, usually at Github. You can still use a local notebook by uploading it to the session as I suggest above. They do though provide additional ways to learn about using MyBinder to serve active notebooks in your browser.)

- 6,607
- 8
- 36
- 93
You need Jupyter Notebook in your machine. That is one option.
Otherwise, you can upload the file into GitHub and open the .ipynb
file from there.

- 911
- 1
- 7
- 18
-
-
1
-
@kibromhft For viewing notebooks in static form, GitHub is better now than it has been in the past; however, still not ideal or as full-featured as the Jupyter ecoystem offering of [nbviewer](https://nbviewer.org/). Things like Plotly plots and other javascript enhanced items will work there that don't on GitHub. Once your notebook is posted anywhere on the web you can go to nbviewer and put in the URL and view it. – Wayne Feb 12 '22 at 18:27