Skip to content

Commit a6edbb0

Browse files
committed
DOC: Add Google Colab data-loading instructions
1 parent 4d83483 commit a6edbb0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

doc/source/user_guide/io.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6520,3 +6520,28 @@ The files ``test.pkl.compress``, ``test.parquet`` and ``test.feather`` took the
65206520
24009288 Oct 10 06:43 test_fixed_compress.hdf
65216521
24458940 Oct 10 06:44 test_table.hdf
65226522
24458940 Oct 10 06:44 test_table_compress.hdf
6523+
Loading data in Google Colab
6524+
----------------------------
6525+
6526+
Google Colab provides two simple ways to load files into pandas: uploading
6527+
files manually or mounting Google Drive.
6528+
6529+
**Option 1: Upload a file**
6530+
6531+
.. code-block:: python
6532+
6533+
from google.colab import files
6534+
uploaded = files.upload()
6535+
6536+
import pandas as pd
6537+
df = pd.read_csv(list(uploaded.keys())[0])
6538+
6539+
**Option 2: Load from Google Drive**
6540+
6541+
.. code-block:: python
6542+
6543+
from google.colab import drive
6544+
drive.mount('/content/drive')
6545+
6546+
import pandas as pd
6547+
df = pd.read_csv('/content/drive/MyDrive/filename.csv')

0 commit comments

Comments
 (0)