cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to save variables in one notebook to be imported into another?

kll
New Contributor III

Say, I have a list of values, dictionaries, variable names in `notebook1.ipynb` that I'd like to re-use / import in another `notebook2.ipynb`. 

For example, in `notebook1.ipynb`, I have the following: 

 

 

var1 = "dallas"

var_lst = [100, 200, 300, 400, 500]

 

 

How do I save this to disk and read / import in `notebook2.ipynb` ?  

1 REPLY 1

Krishnamatta
New Contributor III

You can use %run ./notebook2 after defining variables in notebook1

So notebook2 will use the variables defined in notebook1