I mounted my drive using this :
from google.colab import drive
drive.mount('/content/drive/')
I have a file inside a folder that I want the path of how do I determine the path? Say the folder that contains the file is named 'x' inside my drive
Click on “Choose Files” then select and upload the file. Wait for the file to be 100% uploaded. You should see the name of the file once Colab has uploaded it. Finally, type in the following code to import it into a dataframe (make sure the filename matches the name of the uploaded file).
Mounting Google Drive/content is the root folder of Google Colab and has to be appended to all paths used in the notebook.
The path will be /content/drive/My\ Drive/x/the_file
.
The path as parameter for a function will be /content/drive/My Drive/x/the_file, so without backslash inside My Drive
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With