A lot of the analytical work I do really adapts well to #Jupyter Notebooks. It's very helpful to organize the code into logical chunks, one chunk per cell.

However, now I want to re-run the entire workbook, changing only one parameter.

Is there an easy way to do that without merging all the cells together?

ETA: My notebook has a parameter section at the top, but now I want to re-run for a range of values that would be a pain to do manually.

#JupyterNotebook #ScottProgramming

It looks like there is something called Papermill, but that library is not installed at my site.
@scottmiller42 I'm pretty sure there is a way parameterize Quarto documents. https://quarto.org/
Quarto

An open source technical publishing system for creating beautiful articles, websites, blogs, books, slides, and more. Supports Python, R, Julia, and JavaScript.

Quarto
@davidbody Thanks for the suggestion! Quarto looks interesting, but unfortunately, it doesn't appear to be available to me at my site.

@scottmiller42 That's unfortunate.

But since Jupyter notebooks are "just" text files, maybe... πŸ˜„

@davidbody Hunh, until I read this comment, I didn't even think about trying to run the notebook from the command prompt. Copilot says it is possible, and it looks like it would use the kernel I want it to use.

Thus, I could've modified the code to read an environment variable as the parameter, and execute that within a loop in a number of possible choices including another Jupyter Notebook.

An option to remember for next time (I already solved the hard way).

@davidbody (I inferrerd from your comment a suggestion to edit the Notebook programmatically, which then implied there'd be some way to run that modified Notebook programmatically.)
@scottmiller42 Yes. I haven't used it (that I recall), but see https://nbclient.readthedocs.io/en/latest/
Welcome to nbclient β€” nbclient