1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Python/Colaboratory]Google Drive 上の CSV ファイルを読み込む

Last updated at Posted at 2024-01-28

この記事で書くこと

  • Colaboratory で Google Drive 上の CSV ファイルを読み込む

前提条件

  • ディレクトリの構成は次の通り
マイドライブ
└ Colab Notebooks 
    ├ MachineLearning_20240128.ipynb
    └ wine.csv

スクリーンショット 2024-01-28 20.01.09.png

コード

import pandas as pd
from google.colab import drive

drive.mount('/content/drive')
df = pd.read_csv('drive/My Drive/Colab Notebooks/wine.csv')
df.head()

出力結果

スクリーンショット 2024-01-28 20.04.54.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?