Skip to main content

Code Refactoring using ChatGPT in Jupyter Notebooks

Primary supervisor

Chunyang Chen

Jupyter notebooks have become a popular platform for data scientists to develop and test their code. However, as the number of code cells and markdown cells increase in a notebook, it can become challenging to maintain code quality and refactoring. While integrated development environments (IDEs) like PyCharm and VSCode have code assistants like Copilot, these features are not widely available in Jupyter notebooks. This lack of support for code quality and organization in Jupyter notebooks can lead to difficulties in understanding and maintaining the code. Additionally, the use of pre-trained language models like ChatGPT can be a complex process and requires design of prompts. 




Student cohort

Double Semester


The goal of this project is to use ChatGPT to improve the code quality in Jupyter notebooks by providing suggestions for code generation, commenting, naming conventions, etc. Additionally, the integration of ChatGPT will allow data scientists to easily use pre-trained language models within their Jupyter notebooks, leading to more accurate and efficient code development.



Quaranta, L., Calefato, F. and Lanubile, F., 2022. Eliciting Best Practices for Collaboration with Computational Notebooks. Proceedings of the ACM on Human-Computer Interaction, 6(CSCW1), pp.1-41.


Chattopadhyay, S., Prasad, I., Henley, A.Z., Sarma, A. and Barik, T., 2020, April. What's wrong with computational notebooks? Pain points, needs, and design opportunities. In Proceedings of the 2020 CHI Conference on Human Factors in Computing Systems (pp. 1-12).


Required knowledge


  • Certain knowledge or interests in code refactoring.
  • Experience with GPT or ChatGPT.
  • Know Python and Jupyter notebook.
  • The capability of research, design, and development of a tool’s architecture and components.