Here are the steps to find the file path of your CSV file in Google Colab after you've uploaded it:
Mount your Google Drive:
If you haven't already done so, mount your Google Drive in Colab by running the following code in a cell:
Python
from google.colab import drive
drive.mount('/content/drive')
Use code with caution.
This will prompt you to authorize Colab to access your Google Drive. Follow the instructions to grant access.
Locate your file in the Files sidebar:
Get the file path:
Once your Drive is mounted, you'll see a new folder named "drive" in the Files sidebar on the left side of your Colab notebook.Expand the "drive" folder and navigate to the location where you uploaded your CSV file.
Construct the file path manually:
/content/drive/MyDrive//.vineyard_data.csv and is located directly in your "My Drive", the path would be: /content/drive/MyDrive/vineyard_data.csv/content/drive/MyDrive/Chatbot Data/vineyard_data.csvOnce you have the file path, you can use it in the pd.read_csv() function to load your data into a Pandas DataFrame:
Python
import pandas as pd
file_path = '/content/drive/MyDrive/your_folder/your_data.csv' # Replace with
your actual file path
data = pd.read_csv(file_path)
Use code with caution.
Important Notes:
Example:
vineyard_data.csv and is located in a subfolder named "Chatbot Data" within your My Drive, the path would be:
/content/drive/MyDrive/Chatbot Data/vineyard_data.csv/content/drive/MyDrive/Chatbot Data/My Project/vineyard_data.csv