Discover more from Daily Dose of Data Science
Clear Cell Output In Jupyter Notebook During Run-time
While using Jupyter, we often print many details to track the code's progress.
However, it gets frustrating when the output panel has accumulated a bunch of details, but we are only interested in the most recent output. Moreover, scrolling to the bottom of the output each time can be annoying too.
To clear the output of the cell, you can use the 𝗰𝗹𝗲𝗮𝗿_𝗼𝘂𝘁𝗽𝘂𝘁 method from the 𝗜𝗣𝘆𝘁𝗵𝗼𝗻 package. When invoked, it will remove the current output of the cell, after which you can print the latest details.
Watch a video version of this post on LinkedIn: Post Link.
Thanks for reading Daily Dose of Data Science! Subscribe for free to learn something new and insightful about Python and Data Science every day. Also, get a Free Data Science PDF (250+ pages) with 200+ tips.