Article Complete
    AIM

    Top Jupyter Hacks & Tricks You Should Try

    Top Jupyter Hacks & Tricks You Should Try

    Discover essential Jupyter hacks and tricks to enhance your data science projects. Click to learn how to optimize your workflow today!

    Top Jupyter Hacks & Tricks You Should Try
    Rohit Chatterjee··Updated DECEMBER 30, 2024, 5:30 AM
    5 min

    Since we have recently shared an article on tricks and hacks of Google Colab, it is only fair that similar information is explored around Jupyter notebook to help data scientists navigate it easily. With the period of lockdown getting extended further, the available time could be a boon for several data scientists to become more efficient with Jupyter notebook projects. Before moving to the tricks and hacks, let us first understand what Jupyter notebook is. 

    Jupyter notebook is an open-source web application that allows a user to create and share documents that contain live code, equations, visualisations and narrative text. It also consists of other features, such as:

    • Data cleaning and transformation 
    • Numerical simulation 
    • Statistical modelling
    • Data visualisation 
    • Machine learning

    Now that we have covered the basics of Jupyter notebook, let us proceed to the tricks and hacks you should try.

    Theme Change

    If you have read our article on tricks and hacks of Google Colab, you already know why this point is important. Data scientists spend their entire day glued to the monitor with thousands of codes and the same interface, which may get monotonous over time. So much so, that frustration could lead to less productivity or errors that could have been avoided. When it comes to Google Colab, a few themes are already preinstalled, so a user does not have to enter codes to change a theme. Unfortunately, Jupyter notebook misses on this feature, and thus, coding is required. To change the theme, follow these steps mentioned below:

    • Install themes with the help of anaconda or pip:-

                anaconda- conda install -c conda-forge jupyterthemes

                pip- pip install jupyterthemes

    • Check the theme list- jt - l
    • Theme Select- jt -t chesterish
    • Restore default theme- jt -r

    Change Cell Width

    Data scientists usually work with monitors with high resolution. Thus, they may need to expand cell width to use the extra space, which can be done quickly with a simple method on Jupyter notebook.

    • Install Jupyter themes using anaconda and pip

    anaconda- conda install -c conda-forge jupyterthemes

    pip- conda install -c pip install jupyterthemes 

    • Alter the theme, cell width and cell height as per preference using:

    jt -t chesterish -cellw 100% lineh 170

    Jupyter Nbviewer To Share Notebooks

    While working on Jupyter notebook, everyone will need to find a way to share their work with people. To ease this process, enter the nbviewer.

    Nbviewer is a web application that enables users to enter a URL of a Jupyter Notebook file. Once entered, it renders the notebook into a static HTML web page. Once the rendering process is completed, it provides a user with a stable link to that page which can be shared with others. 

    Nbviewer is not the only option, however. One can use Binder as well to open a static webpage.

    Converting Notebooks Into Slides

    Converting notebooks into slides is a job done by almost everyone to share the notebook in a presentable format. To complete this conversion, several tools are often used. But these tools are not required, since Jupyter provides users with Nbconvert.

    Nbconvert can be used to convert any ipynb file into other static formats such as HTML, LaTeX, PDF, and more.

    Let us take a look at how you can convert a notebook into slides using Nbconvert:

    • Open notebook
    • Go to toolbar
    • Click on view>>slideshow

    Each cell will have a slide-type on the right-hand corner, which needs to be selected as per the content.

    • Go to common terminal and type- jupyter nbconvert [file_name] –to slides

    One can find “[file_name.html] where the code is being run in the folder. Open the file and change the slides by using the keys.

    Run Python Profiler

    Running Python Profiler is an easy task on Jupyter notebook with the help of %prun. A python profiler provides several function calls and execution time, along with other information such as:

    • ncalls 
    • tottime 
    • percall 
    • cumtime
    • percall 

    Your reaction

    Discussion

    What's your take on this story?

    0/1000

    No comments yet — be the first to share your view.

    Explore our newsletters

    Build your routine with some of our top newsletters or view them all here.

    Wake up informed

    Make sense of the day's AI news and breakthroughs with our morning briefing.

    Belamy
    WeeklyBelamySee the latest

    Industry intelligence

    Receive a roundup of AI adoption stories by industry vertical, curated for professionals.

    3x WeeklySector6See the latest

    By signing up, you agree to our Privacy Policy.

    Membership

    Stay ahead with AI insights.

    Unlimited access to premium articles, exclusive analysis, and the stories shaping India's AI economy.

    Subscribe now

    AIM Americas

    1190 Miraloma Way Suite P, Sunnyvale, CA 94085

    AIM India

    1st Floor, Sakti Statesman, Bellandur, Bengaluru – 560103

    © 2026 AIM. All rights reserved.