Skip to content

Conversation

@Atharv-navatre
Copy link

Adds documentation describing how to load data in Google Colab, including
file uploads, Google Drive mounting, and URL-based workflows.

Fixes #62708

@Atharv-navatre
Copy link
Author

#63354 pre-commit.ci autofix

Copy link
Contributor

@afeld afeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for this contribution. See my comments in #63343, as most of them apply here as well. I'll approve whichever is ready first. Appreciate it!

import pandas as pd
df = pd.read_csv("/content/drive/MyDrive/data.csv")
Loading data from a URL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can cut this section, as it isn't really specific to Colab.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Google Colab is a hosted Jupyter notebook environment. Since it runs remotely,
files must be explicitly uploaded or mounted before they can be read by pandas.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful to clarify for beginners, thanks.

uploaded = files.upload()
import pandas as pd
df = pd.read_csv("data.csv")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.. _fsimpl1: https://filesystem-spec.readthedocs.io/en/latest/api.html#built-in-implementations
.. _fsimpl2: https://filesystem-spec.readthedocs.io/en/latest/api.html#other-known-implementations

Loading data in Google Colab notebooks
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being more consistent with the other headings:

Suggested change
Loading data in Google Colab notebooks
Google Colab

Can we also move this section to be right above Google BigQuery?

Loading data in Google Colab notebooks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Google Colab is a hosted Jupyter notebook environment. Since it runs remotely,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's link to it.

url = (
"https://raw.githubusercontent.com/pandas-dev/pandas/main/"
"doc/data/air_quality_no2.csv"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this split enforced by pre-commit? I know you're trying to keep the lines short, but especially given this section is oriented to beginners, I think this split may confuse them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOC: Explain how to load data in Google Colab

2 participants