Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert .json to ipynb

Tags:

I am taking a course that uses ipython notebook. When I try to download the notebook (through File -> Download as -> ipython notebook), I get a file that ends with ".ipynb.json". It doesn't open as an ipython notebook but as a .json file so 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've tried deleting the ".json" in the file name and it doesn't work. How can I convert this file back to something that can be opened and run as an ipython notebook? Thank you very much!

like image 498
Yu Zhang Avatar asked Dec 19 '16 21:12

Yu Zhang


People also ask

Is Ipynb a JSON?

Introduction. Jupyter (né IPython) notebook files are simple JSON documents, containing text, source code, rich media output, and metadata.


1 Answers

My Solution: just remove the filename extension .json. for example, change myfile.ipynb.json to myfile.ipynb. Then, you can open it by a click in jupyter notebook !

I have encounter the same problem as you did. I found a link that describe what ipynb exactly is. see here http://ipython.org/ipython-doc/rel-1.0.0/interactive/nbconvert.html. It says ipynb file is actually json file. Hope this

like image 101
jackie Avatar answered Sep 21 '22 09:09

jackie