3 ms·
The main reason is that one has to fiddle with the code a lot and re-running the whole thing is much too slow. A common example is that a huge text file contai
by fsh 7y ago
The main reason is that one has to fiddle with the code a lot and re-running the whole thing is much too slow.
A common example is that a huge text file containing experimental data gets parsed in the beginning. Then you have to explore the data step-by-step using all kinds of visualization and analysis such as Fourier transforms, curve fitting, etc.
If you simply put everything into one giant python script, for every step you have to re-run the entire thing which takes forever. Of course you can speed things up by writing intermediate results to disk, but this adds tons of boilerplate code and is quite error prone.
One alternative would be to write individual scripts for each step and read them into an interactive REPL shell. However, then you still have to somehow record the proper execution order if you ever want to repeat the analysis.