How do I find which cells in a messy Jupyter notebook actually produced this plot or model, so I can clean it up?
Use a program slicer, which traces the code a result depends on. Static slicers such as Gather read the code without running it, so they keep extra cells. Our nbslicer tracks dependencies while cells run; on 374 real notebook sessions, its slices were on average 66% smaller than a static slicer's and still correct, and they ran 1.34x faster.
Sources: Bolt-on, Compact, and Rapid Program Slicing for Notebooks (VLDB 2023)
Guide: Interfaces for Data Work with LLMs
More questions on this topic
- How do I make AI-generated summaries in a dashboard or table easy to skim?
- How do I get an LLM to write consistent one-line titles or summaries for many items?
- Is there a better way to iterate on prompts when an LLM pipeline runs over many documents?
- Why is it so hard to find a good dataset for my project?
- My RAG answers are wrong. How do I tell whether retrieval or generation is the problem?
- When I change an earlier Jupyter cell, how do I know which later cells to rerun?