Colaboratory is made by google It is a tool that allows you to use the jupyter note environment with a browser.
It is a method to read the file put in Google Drive.
Select Mount Drive → Connect to GOOGLE Drive from the file on the left
If the connection is successful,
You can see your Google Drive files in `python / content / drive / My Drive /`
. I put the Google Colaboratory files in Colab Notebooks.
Check the file path this time. Right-click on the file with the mouse. This time, there was sample_submission.csv in the following path
/content/drive/My Drive/Colab Notebooks/sample_submission.csv"
<img width="427" alt="2020-03-10_11h20_36.png " src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/533844/fb4b2b88-8980-7926-50cc-0ca808a7434d.png ">
## Read the file
You can read it with the following code.
```python
import pandas as pd
train = pd.read_csv("/content/drive/My Drive/Colab Notebooks/sample_submission.csv")
train.head()
I was able to read the file safely.
Recommended Posts