Accessing files locally on cloud notebook

Viewed 256

I am relatively new to Cloud Notebooks. I am currently working on a Machine Learning Project. I'll be working with extremely heavy datasets so I decided to use the Google Cloud Platform to run the notebooks (Jupyter Lab). My question is how can I access some of the excel sheets which are stored on our company's local drive without having to upload them on google drive or other places. The files can not be uploaded as they are highly restricted and proprietary. I will be using python 80% of the times and R 20% of the times.

Thanks!

1 Answers

The only solution is to use Cloud VPN to create an HA VPN gateway to a Peer VPN gateway. With this solution, you will connect the Jupyter Notebook that is in the GCP cloud network to your computer, where your local files are, and this connection is through an encrypted tunnel(VPN). You will connect to this VPN if you want to read the files, and you can disconnect after you are done with that.

You can see more documentation about this product.

After implementing this solution and connecting to the VPN, you can execute your code and access the Excel sheets which are stored in your company's local drive.

You can see this example; with this code, you could read your Excel file:

import pandas as pd

df = pd.read_excel (r'Path where the Excel file is stored\File name.xlsx', sheet_name='your Excel sheet name')
print (df)

You can see this document about the function read_excel.

Related