I wanted to repeat an analysis included in a large jupyter notebook and save a couple of the generated dataframes in a csv file. My first attempt was to open the notebook in jupyter-lab and interactively run the cells I was interested, then add a new cell with my code that saves the relevant data to files.
I was wondering however if I could do the same thing with a script, eg run the 1st and 45th cell of the notebook and then run a few more commands to export the data.
import IPython.display
x = 1
x = x + 1
print(x)
IPython.display.Javascript("Jupyter.notebook.execute_cells([2])")
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.