Saulo Ricci Saulo Ricci - 1 year ago 99
Python Question

How to execute a python notebook inside another one at google cloud datalab

I'd like to execute a python notebook I'had created to data pre-processing inside another notebook related with data classification process. So the last notebook depends on the functions and execution provided by the first notebook.

How could I do that at google cloud datalab environment? I do like to reuse the functions and variables used at the pre-processing notebook on the classification notebook.


Answer Source

The following should work:

myNotebook = <relative path to notebook>

%run $myNotebook

or simply

%run <relative path to notebook>

Note: This does not work if you are running Datalab on Google Cloud Platform.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download