1

I have a few notebooks in my Watson studio project. They use a common set of function definitions. I'm constantly refining these common function definitions so I want them to be in a notebook. How can I share this notebook with the other notebooks?

K. Nagin
  • 11
  • 1
  • The phrase "sharing notebooks" is used with a different meaning in Watson Studio: https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/share-notebooks.html – Roland Weber Aug 27 '19 at 09:08

1 Answers1

1

You cannot include notebooks from other notebooks in Watson Studio on Cloud.

What you can do is let a notebook write a file with your shared function to the project storage. Other notebooks can fetch that file from project storage, save it to the transient disk storage, and import it from there. The project-lib utility will help you with accessing the project storage.

You may use the %save magic to write functions from different cells to a .py file on disk. Then the final cell of the notebook can load that file and write it to the project storage.

Roland Weber
  • 1,865
  • 2
  • 17
  • 27