Convert .json to ipynb

I am taking a course that uses an ipython laptop. When I try to download a laptop (via File -> Download as -> ipython notebook), I get a file that ends with ".ipynb.json". It does not open as an ipython notebook, but as a .json file, something like this:

{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "\n", "_You are currently looking at **version 1.1** of this notebook. To download notebooks and datafiles, as well as get help on Jupyter notebooks in the Coursera platform, visit the [Jupyter Notebook FAQ](https://www.coursera.org/learn/python-data-analysis/resources/0dhYG) course resource._\n", "\n", "---" ] }, ... } 

I tried to remove the ".json" in the file name and it does not work. How can I convert this file back to what can be opened and run as ipython laptop? Thank you very much!

+8
source share
4 answers

My solution: just remove the .json file extension . for example, change myfile.ipynb.json to myfile.ipynb . You can then open it by clicking on Jupyter Notepad!

I encountered the same problem as you. I found a link that describes what ipynb is. see here http://ipython.org/ipython-doc/rel-1.0.0/interactive/nbconvert.html . He says the ipynb file is actually a json file. Hope it

+7
source

On a Mac, you can go and

  1. Right click on filename.ipynb.json
  2. Click on Get Info from the list.
  3. In the Get Info window, find the Name&Extension section, remove the .json extension / suffix from the file name.

Hope this helps!

+2
source

Are you trying to download this from github? In particular, in Google Chrome browsers, I had problems downloading .ipynb files with right-click> Save link as ... I'm not sure if this problem occurs in other browsers (Microsoft Edge, Mozilla Firefox, Safari, etc. .d.).

This causes problems, since it usually doesn’t fully download the file when it is downloaded and it is corrupted, so you cannot download the IPython notebook, which may work correctly. When uploading .ipynb files to Github, you need to catch one click, click Raw , then copy everything (Ctrl + A) and paste it into an empty file (using text editors such as Notepad, Notepad ++.], Vim, etc.) and save it as "what_file_name_you_choose.ipynb". Then you can run this file correctly, assuming that the undamaged file was uploaded to Github.

Many people with very large and complex IPython laptops on Github will inevitably encounter this problem, simply trying to download with the Save As ... link . Hope this helps!

0
source

I opened it as / using nbviewer, and then selected everything and saved it as a β€œtxt” file, which I then opened in Notepad ++. Then I saved it as a file with the ipynb extension and opened it in my Jupyter notepad well.

0
source

Source: https://habr.com/ru/post/1261531/


All Articles