Issue
I prepared a jupyter notebook that is a python template for a report. It displays pandas dataframes and plots some charts. After execution, I want to save it either in html or pdf format. In the first cell I initialize the variable month = 2
.
My question is can I automatically make it run several times for months from collection [1,2,5,6]
and store each execution as a html file?
Solution
I would advise to put the code that generates the report inside a function. Then call the function from a loop. Which loops over an array of the different parameters you want to pass along each report. Then you just run your notebook once.
Otherwise pass the parameters to your notebook described here: Passing command line arguments to argv in jupyter/ipython notebook
and then export to html like so: https://stackoverflow.com/a/38909626/9268396
Answered By - Thomas Guntenaar
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.