![]() ![]() Once executed, you will be able to see the new file ( foo.txt) at. The example below shows how to mount your Google Drive on your runtime using an authorization code, and how to write and read files there. Path_to_csv = '/content/drive/MyDrive/TEST/DATA/data.csv'įor more information on working with Google Drive in Colab, see the tutorial/docs on External data: Local Files, Drive, Sheets, and Cloud Storage: Then the corresponding path would be: # Check the root folder So, for example, if you placed data.csv at My Drive > TEST > DATA: The best way to visually see which files and folders are available and how they are organized is to open your Drive on your browser at: Google Drive does not follow the same folder structure as what you have on your local PC. I have tried replacing C:\Users\Desktop\data.csv with /gdrive/my drive/Users\Desktop\data.csv" but i get error message that is not found. path_to_csv = '/content/drive/MyDrive/data.csv' So, if you uploaded your data.csv at the top-level/root of your Google Drive folder ( '/content/drive/MyDrive'), then it should also show up there at the top-level/root of the /content/drive/MyDrive directory. Basically, the same mount path you passed to drive.mount should be exactly the same base path you use everywhere else. Also, the / at the start of the path is important. Note that you should be using / instead of a \ everywhere in your paths, as Google Colab is a Linux-based system (see Why does Windows use backslashes for paths and Unix forward slashes?). ![]() rw- 1 root root 18 Apr 11 02:37 data.csv ![]() ![]() Going further: !ls -l /content/drive/MyDrive/ You can browse the contents of your mounted Google Drive folder using: from lab import drive ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |