File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -6520,3 +6520,45 @@ 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+
6524+ Loading data in Google Colab
6525+ '''''''''''''''''''''''''''
6526+
6527+ Google Colab is a hosted Jupyter notebook environment. Since it runs remotely,
6528+ files must be explicitly uploaded or mounted before they can be read by pandas.
6529+
6530+ Uploading local files
6531+ ~~~~~~~~~~~~~~~~~~~~~
6532+
6533+ Files can be uploaded directly to the Colab runtime using ``google.colab.files ``:
6534+
6535+ .. code-block :: python
6536+
6537+ from google.colab import files
6538+ uploaded = files.upload()
6539+
6540+ import pandas as pd
6541+ df = pd.read_csv(" data.csv" )
6542+
6543+ Using Google Drive
6544+ ~~~~~~~~~~~~~~~~~~
6545+
6546+ Google Drive can be mounted to make files available to the runtime:
6547+
6548+ .. code-block :: python
6549+
6550+ from google.colab import drive
6551+ drive.mount(" /content/drive" )
6552+
6553+ import pandas as pd
6554+ df = pd.read_csv(" /content/drive/MyDrive/data.csv" )
6555+
6556+ Loading data from a URL
6557+ ~~~~~~~~~~~~~~~~~~~~~~
6558+
6559+ Data hosted remotely can be read directly using a URL:
6560+
6561+ .. code-block :: python
6562+
6563+ import pandas as pd
6564+ df = pd.read_csv(" https://example.com/data.csv" )
You can’t perform that action at this time.
0 commit comments