I would take a notebook that demonstrates what's happening to my data any day over a docstring that may or may not be correct. Particularly if I have to render it in yet a third system to juggle and manually keep in sync.
So we've gone from notebooks to... notebook + py + docstring... I'm sure we can think of another useless layer of indirection to bolt on.
I'm not sure you know what a docstring is if this is your response.
I really feel like you do not understand what a docstring is. This does not make any sense.
> the way you could if you broke the function up into cells
If your logic is broken up across cells then you cannot use it anywhere but in that notebook...
> If your logic is broken up across cells then you cannot use it anywhere but in that notebook...
You don't seem to understand how notebooks can be used and processed themselves. They are just data and there are libraries for loading and transforming them. You might check out pydev and papermill to get an idea about this (and maybe also literate programming in general).
Using notebooks as functions is a bad idea. I think papermill is trash.
Notebooks are good for illustrating what you did and what you got. They are not good for illustrating how you did it.