Thursday, April 19, 2018

Quick command to extract python commands (inputs) from Jupyter notebook

import json
jsonObj = json.load(open('Working with Text Data.ipynb'))
for i  in [cells['source'] for cells in jsonObj['cells']]:
    print (i[0]) if len(i)>0 else ''