Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 589
AlvinfromDiaspar Avatar asked Dec 03 '25 20:12

AlvinfromDiaspar


1 Answers

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 
like image 156
redeemefy Avatar answered Dec 05 '25 08:12

redeemefy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!