Reputation: 11
I am using google cloud data lab, and I have several data frames in different notebooks. Is there any way to access all these data frames in one notebook? I use SQL and python for writing the codes.
The data frames are the base tables for user engagement in an android app. These base tables are user data, experience data, and session data.
Now, if I want to generate an analytics table that uses all these base tables( in different notebooks), then is there a way to use these tables in a different notebook
Upvotes: 1
Views: 432
Reputation: 1709
To access functions/variables from other notebooks in Google Cloud Datalab, simply run the other notebooks from your current notebook using the line magic command %run
For example:
'notebook_a.ipynb'
variable_a = 5
%run 'notebook_a.ipynb'
variable_a
which exists in another notebook.Adjust the path accordingly if the notebook is not the same directory with %run <relative path to notebook>
I posted a similar answer in a related Stack Overflow post.
Note: This does not work if you are running Datalab on Google Cloud Platform.
Upvotes: 1