jupyter-notebookjupyter

Jupyter Notebook cell - Repeat same imports?


I have multiple Notebook cells where im importing the same libraries. Is there a way to import these libraries once (like in the very 1st cell) and allow all other cells to use them?

Since my notebook has several cells, each importing the same libraries, i'm starting to see alot of redundancies.


Solution

  • Of course! You can add all your libraries at the very top of your notebook. All of them will be available for use.

    import pandas as pd
    import numpy as np 
    import matolotlib.pyplot as plt 
    import seaborn as sns