Method Names in Jupyter Notebooks: An Exploratory Study
Carol Wong 1 , Gunnar Larsen 1 , Rocky Huang 1 , Bonita Sharif 2 , Anthony Peruma 1 · 2025
Read Method Names in Jupyter Notebooks: An Exploratory Study by Carol Wong 1 , Gunnar Larsen 1 , Rocky Huang 1 , Bonita Sharif 2 , Anthony Peruma 1 (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2504-20330.txt.
Introduction
Carol Wong and co-authors study method names in Jupyter Notebooks in a 2025 arXiv paper. Good names help readers grasp code, but most naming research covers standard software projects. Little is known about naming inside notebooks, a common tool for data work.
The team analyzed 691 methods across 384 notebooks. They checked naming style, grammar patterns, and the use of short forms. Notebook names leaned toward brevity and broke with standard patterns. They found 68 distinct grammar patterns, and only about 56 percent of methods began with a verb. About 30 percent of names held abbreviations or acronyms. The findings can guide tools and teaching for notebook code.
Catalog record
| CREATOR | Carol Wong 1 , Gunnar Larsen 1 , Rocky Huang 1 , Bonita Sharif 2 , Anthony Peruma 1 |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 59 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2504-20330
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Method Names in Jupyter Notebooks: An Exploratory Study Carol Wong 1 , Gunnar Larsen 1 , Rocky Huang 1 , Bonita Sharif 2 , Anthony Peruma 1 Abstract Method names play an important role in communicating the purpose and behavior of their functionality. Research has shown that high-quality names significantly improve code comprehension and the overall maintainability of software. However, these studies primarily focus on naming practices in traditional software development. There is limited research on naming patterns in Jupyter Notebooks, a popular environment for scientific computing and data analysis. In this exploratory study, we analyze the naming practices found in 691 methods across 384 Jupyter Notebooks, focusing on three key aspects: naming style conventions, grammatical composition, and the use of abbreviations and acronyms. Our findings reveal distinct characteristics of notebook method names, including a preference for conciseness and deviations from traditional naming patterns. We identified 68 unique grammatical patterns, with only 55.57% of methods beginning with a verb. Further analysis revealed that half of the methods with return statements do not start with a verb. We also found that 30.39% of method names contain abbreviations or acronyms, representing mathematical or statistical terms and image processing concepts, among others. We envision our findings contributing to developing specialized tools and techniques for evaluating and recommending high-quality names in scientific code and creating educational resources tailored to the notebook development community. I Introduction Methods are fundamental elements of source code, encapsulating behavior and promoting code reuse and modularity [ 1 ] . They represent the smallest unit of functionality, enabling practitioners to break down complex processes into manageable, logical segments. This decomposition makes it easier to read, understand, and test the program [ 2 , 3 ] . Equally important to having well-defined methods is the necessity for having method names that effectively communicate the purpose and functionality of a method [ 4 , 5 ] . This is particularly important as developers spend 58-70% of their time trying to comprehend code and only 5% editing it [ 6 ] . Extensive research has examined identifier names, exploring their structure, semantics, evolution, and developers’ perceptions [ 7 , 8 , 9 , 10 , 11 , 12 ] . These studies show that effective identifier names are crucial for improving code readability and maintainability and can improve code comprehension by as much as 19% [ 13 ] . However, most of this research has primarily focused on code written in traditional programming environments by developers with formal computing backgrounds. As a result, there is a gap in our understanding of naming conventions in alternative environments like Jupyter Notebooks. Unlike traditional Python programs, which are typically linear text files often spread across multiple files, Jupyter Notebooks are interactive documents divided into executable code cells interspersed with documentation and output cells. These notebooks offer an environment that supports interactive and iterative data exploration, prototyping, scratch work, creating tutorials and teaching aids, all within a single document [ 14 , 15 ] . This unique combination of factors can influence how practitioners, many of whom lack a formal background in computer science [ 16 , 17 ] , name and structure their methods, particularly in the context of scientific programming [ 18 , 19 ] . While several studies have examined code quality in Jupyter Notebooks, focusing on style violations, reproducibility issues, and structural complexity and organization [ 20 , 21 , 22 , 23 , 14 , 16 ] , the quality of identifier names, a key factor in code comprehension, remains underexplored in notebook environments. I-A Motivating Example Consider the methods shown in Listings 1 and 2 , which were extracted from a dataset of open-source Jupyter Notebooks [ 22 ] . In Listing 1 , the name is composed of a single term which happens to be an acronym, ‘rmse.’ This stands for ‘Root Mean Square Error’, which is a domain-specific term often used in fields like statistics, and machine learning and is generally unfamiliar to those outside of these fields. Using acronyms like ‘rmse’ as method names can lead to confusion as it assumes that the users of the code will have prior knowledge of the term, which might not always be the case, especially for novices or interdisciplinary teams [ 13 ] . Further, the method name deviates from naming practices by not following a verb phrase pattern, which can lead to confusion regarding its action or behavior [ 10 ] . A more descriptive name like ‘compute_root_mean_square_error’ would better convey the method’s purpose. Listing 2 , in contrast, includes a verb (‘search’), which ideally should be at the start of the name. The name has two other issues: (1) it does not follow Python’s recommended snake_case convention, and (2) it lacks a conventional boolean prefix, despite returning a boolean value. A more suitable name would be: ‘is_game_category_present.’ ⬇ def rmse ( predicted , actual ): # formula for rmse residual = predicted - actual residual_sq = residual ** 2 mean_sq = np . mean ( residual_sq ) rmse_value = np . sqrt ( mean_sq ) # return rmse_value return rmse_value Listing 1: Method name lacking a verb prefix and composed of an acronym. ⬇ def gamesearch ( x ): gamecategory =[ ’computer games’ , ’video games’ , ’video-games’ , ’computer-games’ , ’mmorpg’ , ’nintendo’ , ’playstation’ ] regex = re . compile ( "|" . join ( word for word in gamecategory ), re . IGNORECASE ) if regex . search ( x [ ’summary’ ] or x [ ’title’ ] ): return 1 else : return 0 Listing 2: Method name violating Python’s snake_case convention and not reflecting its actual behaviour. These examples highlight the need to explore method naming practices in notebook environments, as they may not only share common naming violations with traditional programming environments ( [ 4 , 24 , 25 ] ) but also exhibit unique or more frequent violations due to their unique characteristics. I-B Goal & Research Questions The paper presents an exploratory study to enhance our understanding of naming practices in scientific programs, specifically focusing on code contained within Jupyter Notebooks. Our goal is to examine the characteristics of method names in notebook environments, including their grammatical structure, case conventions, name length, and use of abbreviations and acronyms . We focus our evaluation on method names as they encapsulate behavior and represent primary units of functionality within code [ 4 ] . Further, method names play a crucial role in conveying the functionality and intent of code segments, directly impacting program comprehension and maintainability [ 26 , 5 ] . By understanding how practitioners typically craft method names in scientific programs, we envision our findings leading to: (1) the development of tools and techniques in method name recommendation and appraisal in the context of scientific programming and (2) the development of educational materials to train scientific programmers in effective naming practices. Furthermore, our focus on naming patterns provides the groundwork for exploring broader issues such as notebook reproducibility and collaboration practices. We aim to answer the following research questions (RQs): RQ1: What are the prevailing patterns in case conventions and name length of method names within Jupyter Notebooks? Case conventions and