2021年4月10日星期六

How to set the path to Google Drive files from Google Colab?

I am using Google Colab and my code has the following local path to my CSV file in my laptop:

path_csv = "C:\\Users\\Desktop\\data.csv"  

I have linked my Google Drive to my notebook in Colab by using the following code:

from google.colab import drive  drive.mount('/content/gdrive')  

And I have uploaded my CSV file to Google Drive.

My question is what to put instead of "C:\\users\\...." to make it work in Google Colab?

I have tried replacing C:\\Users\\Desktop\\data.csv with /gdrive/my drive/Users\\Desktop\\data.csv" but I get error message that the file is not found.

FileNotFoundError: [Errno 2] No such file or directory:

https://stackoverflow.com/questions/67040328/how-to-set-the-path-to-google-drive-files-from-google-colab April 11, 2021 at 08:01AM

没有评论:

发表评论