Hi Amit, Using external files in Watson Studio (WS) in the IBM Cloud is not hard to do but it is not intuitively obvious.
Whenever you import a notebook and data assets into a WS project, the data assets (like your JSON file) get placed into Cloud Object Storage (COS). Once there, your notebook can't access it in the way you did before by just accessing filename.json.
One way to get the file out of COS is to use the IBM Python project-lilb library:
https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/project-lib-python.htmlThat library has functions to read files out of COS and then writing them to the virtual disk used by WS notebooks. Once written to the disk, you can then access the files using regular Python library functions.
I've written some guidance and a couple of little functions (cos2file and file2cos) that explain how to incorporate project-lib functions into your notebooks, located here:
http://ibm.biz/notebook-in-studio------------------------------
Ray Lopez, Ph.D.
Data Scientist & Enablement Guru
IBM Data Science & AI
ray.lopez@us.ibm.com------------------------------
Original Message:
Sent: Tue February 11, 2020 10:27 AM
From: AMIT LOHAKARE
Subject: How to refer JSON file in Jupyter notebook
Hi, I am new to watson notebook. I have to refer a json file in my Jupyter notebook. Can someone please guide on how to add a file and refer it from my Jupyter notebook. Thanks in advance !
------------------------------
Thanks!
AMIT LOHAKARE
------------------------------
#WatsonStudio