I have a notebook, which can do some complex data analysis with one dataset. At the end, it saves the notebook and converts into HTML
, so I can view the result later without running the notebook again. One example is this:
https://cdn.rawgit.com/cqcn1991/Wind-Speed-Analysis/master/output_HTML/marham.html
Now, I want to run the notebook over many, different datasets. How can I do it?
Maybe something like
files = [
'./data/NCDC/cn/binhai/dat.txt',
'./data/NCDC/cn/luogang/dat.txt',
"./data/NCDC/cn/tianjing/dat.txt",
"./data/NCDC/cn/gushi/dat.txt",
"./data/NCDC/cn/yueyang/dat.txt",
]
for input_file_path in files:
run_notebook('GMM.ipynb', input_file_path)
My thougths:
I find Run parts of a ipython notebook in a loop / with different input parameter, but it's run part of the cells within the notebook.
Scientific Computing & Ipython Notebook: How to organize code? provides a solution to run notebook within a host notebook. However, it's not that the target notebook gets runned, but the target notebook's code run within the host's environment. That leaves the original notebook un-changed, and when saving into HTML, the results are all the same.