- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2019 04:08 PM
@Prabhu4284 When I run Notebook B (which defines a function) it is still not defined in Notebook A. Are you sure we can import all things (functions, variables, etc.)? It appears from the Databricks documentation that only strings can be shared between Notebooks and pointers to data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2020 07:53 AM
I declared a function in notebook commonFunction and called it from other function just by giving this command:
%run ./CommonFunction
I went ahead and used the function defiend in other notebook
infact o could access the variable defined in other notebook and vise versa too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2020 12:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2021 10:22 PM
I have a programming background so restarting my kernel every and running things top to bottom was always common sense to me. I do agree though that it can be misleading and people may not make that assumption. I think one flaw with his programming style at the end that notebooks solve is having the history of how you checked your data throughout the process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 04:16 PM
Of course you can, in your primary notebook, use the %run magic command followed by the path or name of the notebook file you want to run, like this:
%run /path/to/other_notebook.ipynb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 04:43 PM
absolutely you can.
there is databricks documentation explaining everything you need to know here: https://docs.databricks.com/notebooks/notebook-workflows.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 04:58 PM
YES. You can use this script to do it
%run ./path_to_other_notebook