A Large-Scale Comparison of Python Code in Jupyter Notebooks and Scripts
Not on the map. Why?
Abstract (arXiv)
In recent years, Jupyter notebooks have grown in popularity in several domains of software engineering, such as data science, machine learning, and computer science education. Their popularity has to do with their rich features for presenting and visualizing data, however, recent studies show that notebooks also share a lot of drawbacks: high number of code clones, low reproducibility, etc. In this work, we carry out a comparison between Python code written in Jupyter Notebooks and in traditional Python scripts. We compare the code from two perspectives: structural and stylistic. In the first part of the analysis, we report the difference in the number of lines, the usage of functions, as well as various complexity metrics. In the second part, we show the difference in the number of stylistic issues and provide an extensive overview of the 15 most frequent stylistic issues in the studied mediums. Overall, we demonstrate that notebooks are characterized by the lower code complexity, however, their code could be perceived as more entangled than in the scripts. As for the style, notebooks tend to have 1.4 times more stylistic issues, but at the same time, some of them are caused by specific coding practices in notebooks and should be considered as false positives. With this research, we want to pave the way to studying specific problems of notebooks that should be addressed by the development of notebook-specific tools, and provide various insights that can be useful in this regard.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). First posted on arXiv 30 Mar 2022.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2023: 2; 2024: 2; 2025: 1; 2026: 2.
7 papers.
- 2023From Commit Message Generation to History-Aware Commit Message Completioncited by 16
- 2024Untangling Knots: Leveraging LLM for Error Resolution in Computational Notebookscited by 2
- 2023DocGen: Generating Detailed Parameter Docstrings in Pythoncited by 0
- 2024Predicting the Understandability of Computational Notebooks through Code Metrics Analysiscited by 0
- 2025Graph-of-Causal Evolution: Challenging Chain-of-Model for Reasoningcited by 0
- 2026JupOtter: Cell-Level Bug Detection in Jupyter Notebookscited by 0
- 2026Assembling Insights for Agentic Machine Learning Engineering Systemscited by 0
- 2026Assembling Insights for Agentic Machine Learning Engineering Systems4 Oct 2026
- 2026JupOtter: Cell-Level Bug Detection in Jupyter Notebooks22 Jun 2026
- 2025Graph-of-Causal Evolution: Challenging Chain-of-Model for Reasoning9 Jun 2025
- 2024Predicting the Understandability of Computational Notebooks through Code Metrics Analysis16 Jun 2024
- 2024Untangling Knots: Leveraging LLM for Error Resolution in Computational Notebooks26 Mar 2024
- 2023DocGen: Generating Detailed Parameter Docstrings in Python11 Nov 2023
- 2023From Commit Message Generation to History-Aware Commit Message Completion15 Aug 2023