Skip to main content
As I tried the previous given code it shows error in "(path)" to make the code work use "(file)".
Source Link

Try:

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

This commands will bring you to a Google Authentication step. You should see a screen with Google Drive File Stream wants to access your Google Account. After you allow permission, copy the given verification code and paste it in the box in Colab.

In the notebook, click on the charcoal > on the top left of the notebook and click on Files. Locate the data folder you created earlier and find your data. Right-click on your data and select Copy Path. Store this copied path into a variable and you are ready to go.

file = "copied path" df = pd.read_csv(pathfile) df.head() 

TIP: Add a slash (/) as part of the name of directory (for Linux or Mac users). Eg: "/content/drive/My Drive/Colab Notebooks/data/xpto.csv"

Try:

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

This commands will bring you to a Google Authentication step. You should see a screen with Google Drive File Stream wants to access your Google Account. After you allow permission, copy the given verification code and paste it in the box in Colab.

In the notebook, click on the charcoal > on the top left of the notebook and click on Files. Locate the data folder you created earlier and find your data. Right-click on your data and select Copy Path. Store this copied path into a variable and you are ready to go.

file = "copied path" df = pd.read_csv(path) df.head() 

TIP: Add a slash (/) as part of the name of directory (for Linux or Mac users). Eg: "/content/drive/My Drive/Colab Notebooks/data/xpto.csv"

Try:

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

This commands will bring you to a Google Authentication step. You should see a screen with Google Drive File Stream wants to access your Google Account. After you allow permission, copy the given verification code and paste it in the box in Colab.

In the notebook, click on the charcoal > on the top left of the notebook and click on Files. Locate the data folder you created earlier and find your data. Right-click on your data and select Copy Path. Store this copied path into a variable and you are ready to go.

file = "copied path" df = pd.read_csv(file) df.head() 

TIP: Add a slash (/) as part of the name of directory (for Linux or Mac users). Eg: "/content/drive/My Drive/Colab Notebooks/data/xpto.csv"

added 86 characters in body
Source Link
Andre Araujo
  • 2.4k
  • 2
  • 30
  • 50

Try:

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

This commands will bring you to a Google Authentication step. You should see a screen with Google Drive File Stream wants to access your Google Account. After you allow permission, copy the given verification code and paste it in the box in Colab.

In the notebook, click on the charcoal > on the top left of the notebook and click on Files. Locate the data folder you created earlier and find your data. Right-click on your data and select Copy Path. Store this copied path into a variable and you are ready to go.

file = "copied path" df = pd.read_csv(path) df.head() 

TIP: Add a slash (/) as part of the name of directory (for Linux or Mac users). Eg: "/content/drive/My Drive/Colab Notebooks/data/xpto.csv"

Try:

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

This commands will bring you to a Google Authentication step. You should see a screen with Google Drive File Stream wants to access your Google Account. After you allow permission, copy the given verification code and paste it in the box in Colab.

In the notebook, click on the charcoal > on the top left of the notebook and click on Files. Locate the data folder you created earlier and find your data. Right-click on your data and select Copy Path. Store this copied path into a variable and you are ready to go.

file = "copied path" df = pd.read_csv(path) df.head() 

Try:

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

This commands will bring you to a Google Authentication step. You should see a screen with Google Drive File Stream wants to access your Google Account. After you allow permission, copy the given verification code and paste it in the box in Colab.

In the notebook, click on the charcoal > on the top left of the notebook and click on Files. Locate the data folder you created earlier and find your data. Right-click on your data and select Copy Path. Store this copied path into a variable and you are ready to go.

file = "copied path" df = pd.read_csv(path) df.head() 

TIP: Add a slash (/) as part of the name of directory (for Linux or Mac users). Eg: "/content/drive/My Drive/Colab Notebooks/data/xpto.csv"

Source Link
Andre Araujo
  • 2.4k
  • 2
  • 30
  • 50

Try:

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

This commands will bring you to a Google Authentication step. You should see a screen with Google Drive File Stream wants to access your Google Account. After you allow permission, copy the given verification code and paste it in the box in Colab.

In the notebook, click on the charcoal > on the top left of the notebook and click on Files. Locate the data folder you created earlier and find your data. Right-click on your data and select Copy Path. Store this copied path into a variable and you are ready to go.

file = "copied path" df = pd.read_csv(path) df.head()