Skip to content

DOC: make shared includes for describing the datasets in the Getting Started tutorials #38735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 4 additions & 29 deletions doc/source/getting_started/intro_tutorials/02_read_write.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,13 @@
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div data-toggle="collapse" href="#collapsedata" role="button" aria-expanded="false" aria-controls="collapsedata">
<span class="badge badge-dark">Titanic data</span>
</div>
<div class="collapse" id="collapsedata">
<div class="card-body">
<p class="card-text">

This tutorial uses the Titanic data set, stored as CSV. The data
consists of the following data columns:

- PassengerId: Id of every passenger.
- Survived: This feature have value 0 and 1. 0 for not survived and 1
for survived.
- Pclass: There are 3 classes: Class 1, Class 2 and Class 3.
- Name: Name of passenger.
- Sex: Gender of passenger.
- Age: Age of passenger.
- SibSp: Indication that passenger have siblings and spouse.
- Parch: Whether a passenger is alone or have family.
- Ticket: Ticket number of passenger.
- Fare: Indicating the fare.
- Cabin: The cabin of passenger.
- Embarked: The embarked category.

.. include:: titanic.rst

.. raw:: html

</p>
<a href="https://github.com/pandas-dev/pandas/tree/master/doc/data/titanic.csv" class="btn btn-dark btn-sm">To raw data</a>
</div>
</div>
</li>
</ul>
</li>
</ul>
</div>

How do I read and write tabular data?
Expand Down
34 changes: 3 additions & 31 deletions doc/source/getting_started/intro_tutorials/03_subset_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,8 @@
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div data-toggle="collapse" href="#collapsedata" role="button" aria-expanded="false" aria-controls="collapsedata">
<span class="badge badge-dark">Titanic data</span>
</div>
<div class="collapse" id="collapsedata">
<div class="card-body">
<p class="card-text">

This tutorial uses the Titanic data set, stored as CSV. The data
consists of the following data columns:

- PassengerId: Id of every passenger.
- Survived: This feature has value 0 and 1. 0 for not survived and 1
for survived.
- Pclass: There are 3 classes: Class 1, Class 2 and Class 3.
- Name: Name of passenger.
- Sex: Gender of passenger.
- Age: Age of passenger.
- SibSp: Indication that passengers have siblings and spouses.
- Parch: Whether a passenger is alone or has a family.
- Ticket: Ticket number of passenger.
- Fare: Indicating the fare.
- Cabin: The cabin of passenger.
- Embarked: The embarked category.

.. raw:: html

</p>
<a href="https://github.com/pandas-dev/pandas/tree/master/doc/data/titanic.csv" class="btn btn-dark btn-sm">To raw data</a>
</div>
</div>
.. include:: titanic.rst

.. ipython:: python

Expand All @@ -54,8 +26,8 @@ consists of the following data columns:

.. raw:: html

</li>
</ul>
</li>
</ul>
</div>

How do I select a subset of a ``DataFrame``?
Expand Down
20 changes: 1 addition & 19 deletions doc/source/getting_started/intro_tutorials/04_plotting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,8 @@
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div data-toggle="collapse" href="#collapsedata" role="button" aria-expanded="false" aria-controls="collapsedata">
<span class="badge badge-dark">Air quality data</span>
</div>
<div class="collapse" id="collapsedata">
<div class="card-body">
<p class="card-text">

For this tutorial, air quality data about :math:`NO_2` is used, made
available by `openaq <https://openaq.org>`__ and using the
`py-openaq <http://dhhagan.github.io/py-openaq/index.html>`__ package.
The ``air_quality_no2.csv`` data set provides :math:`NO_2` values for
the measurement stations *FR04014*, *BETR801* and *London Westminster*
in respectively Paris, Antwerp and London.

.. raw:: html

</p>
<a href="https://github.com/pandas-dev/pandas/tree/master/doc/data/air_quality_no2.csv" class="btn btn-dark btn-sm">To raw data</a>
</div>
</div>
. include:: air_quality_no2.rst
Copy link
Member

Choose a reason for hiding this comment

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

There is a missing second dot here, I think (at the beginning of the line)

Copy link
Member Author

@afeld afeld Dec 31, 2020

Choose a reason for hiding this comment

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

I need to stop making pull requests when sleep deprived 🤦 Sorry! Fixed in #38839.


.. ipython:: python
Expand Down
20 changes: 1 addition & 19 deletions doc/source/getting_started/intro_tutorials/05_add_columns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,8 @@
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div data-toggle="collapse" href="#collapsedata" role="button" aria-expanded="false" aria-controls="collapsedata">
<span class="badge badge-dark">Air quality data</span>
</div>
<div class="collapse" id="collapsedata">
<div class="card-body">
<p class="card-text">

For this tutorial, air quality data about :math:`NO_2` is used, made
available by `openaq <https://openaq.org>`__ and using the
`py-openaq <http://dhhagan.github.io/py-openaq/index.html>`__ package.
The ``air_quality_no2.csv`` data set provides :math:`NO_2` values for
the measurement stations *FR04014*, *BETR801* and *London Westminster*
in respectively Paris, Antwerp and London.

.. raw:: html

</p>
<a href="https://github.com/pandas-dev/pandas/tree/master/doc/data/air_quality_no2.csv" class="btn btn-dark btn-sm">To raw data</a>
</div>
</div>
. include:: air_quality_no2.rst
Copy link
Member

Choose a reason for hiding this comment

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

here as well


.. ipython:: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,8 @@
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div data-toggle="collapse" href="#collapsedata" role="button" aria-expanded="false" aria-controls="collapsedata">
<span class="badge badge-dark">Titanic data</span>
</div>
<div class="collapse" id="collapsedata">
<div class="card-body">
<p class="card-text">

This tutorial uses the Titanic data set, stored as CSV. The data
consists of the following data columns:

- PassengerId: Id of every passenger.
- Survived: This feature have value 0 and 1. 0 for not survived and 1
for survived.
- Pclass: There are 3 classes: Class 1, Class 2 and Class 3.
- Name: Name of passenger.
- Sex: Gender of passenger.
- Age: Age of passenger.
- SibSp: Indication that passenger have siblings and spouse.
- Parch: Whether a passenger is alone or have family.
- Ticket: Ticket number of passenger.
- Fare: Indicating the fare.
- Cabin: The cabin of passenger.
- Embarked: The embarked category.

.. raw:: html

</p>
<a href="https://github.com/pandas-dev/pandas/tree/master/doc/data/titanic.csv" class="btn btn-dark btn-sm">To raw data</a>
</div>
</div>
.. include:: titanic.rst

.. ipython:: python

Expand All @@ -54,8 +26,8 @@ consists of the following data columns:

.. raw:: html

</li>
</ul>
</li>
</ul>
</div>

How to calculate summary statistics?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,8 @@
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div data-toggle="collapse" href="#collapsedata" role="button" aria-expanded="false" aria-controls="collapsedata">
<span class="badge badge-dark">Titanic data</span>
</div>
<div class="collapse" id="collapsedata">
<div class="card-body">
<p class="card-text">

This tutorial uses the Titanic data set, stored as CSV. The data
consists of the following data columns:

- PassengerId: Id of every passenger.
- Survived: This feature have value 0 and 1. 0 for not survived and 1
for survived.
- Pclass: There are 3 classes: Class 1, Class 2 and Class 3.
- Name: Name of passenger.
- Sex: Gender of passenger.
- Age: Age of passenger.
- SibSp: Indication that passenger have siblings and spouse.
- Parch: Whether a passenger is alone or have family.
- Ticket: Ticket number of passenger.
- Fare: Indicating the fare.
- Cabin: The cabin of passenger.
- Embarked: The embarked category.

.. raw:: html

</p>
<a href="https://github.com/pandas-dev/pandas/tree/master/doc/data/titanic.csv" class="btn btn-dark btn-sm">To raw data</a>
</div>
</div>
.. include:: titanic.rst

.. ipython:: python

Expand Down Expand Up @@ -108,8 +80,8 @@ measurement.

.. raw:: html

</li>
</ul>
</li>
</ul>
</div>

How to reshape the layout of tables?
Expand Down
35 changes: 3 additions & 32 deletions doc/source/getting_started/intro_tutorials/10_text_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,7 @@
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div data-toggle="collapse" href="#collapsedata" role="button" aria-expanded="false" aria-controls="collapsedata">
<span class="badge badge-dark">Titanic data</span>
</div>
<div class="collapse" id="collapsedata">
<div class="card-body">
<p class="card-text">

This tutorial uses the Titanic data set, stored as CSV. The data
consists of the following data columns:

- PassengerId: Id of every passenger.
- Survived: This feature have value 0 and 1. 0 for not survived and 1
for survived.
- Pclass: There are 3 classes: Class 1, Class 2 and Class 3.
- Name: Name of passenger.
- Sex: Gender of passenger.
- Age: Age of passenger.
- SibSp: Indication that passenger have siblings and spouse.
- Parch: Whether a passenger is alone or have family.
- Ticket: Ticket number of passenger.
- Fare: Indicating the fare.
- Cabin: The cabin of passenger.
- Embarked: The embarked category.

.. raw:: html

</p>
<a href="https://github.com/pandas-dev/pandas/tree/master/doc/data/titanic.csv" class="btn btn-dark btn-sm">To raw data</a>
</div>
</div>
.. include:: titanic.rst

.. ipython:: python

Expand All @@ -54,8 +25,8 @@ consists of the following data columns:

.. raw:: html

</li>
</ul>
</li>
</ul>
</div>

How to manipulate textual data?
Expand Down
24 changes: 24 additions & 0 deletions doc/source/getting_started/intro_tutorials/air_quality_no2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
:orphan:

.. raw:: html

<div data-toggle="collapse" href="#collapsedata" role="button" aria-expanded="false" aria-controls="collapsedata">
<span class="badge badge-dark">Air quality data</span>
</div>
<div class="collapse" id="collapsedata">
<div class="card-body">
<p class="card-text">

For this tutorial, air quality data about :math:`NO_2` is used, made
available by `openaq <https://openaq.org>`__ and using the
`py-openaq <http://dhhagan.github.io/py-openaq/index.html>`__ package.
The ``air_quality_no2.csv`` data set provides :math:`NO_2` values for
the measurement stations *FR04014*, *BETR801* and *London Westminster*
in respectively Paris, Antwerp and London.

.. raw:: html

</p>
<a href="https://github.com/pandas-dev/pandas/tree/master/doc/data/air_quality_no2.csv" class="btn btn-dark btn-sm">To raw data</a>
</div>
</div>
34 changes: 34 additions & 0 deletions doc/source/getting_started/intro_tutorials/titanic.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
:orphan:

.. raw:: html

<div data-toggle="collapse" href="#collapsedata" role="button" aria-expanded="false" aria-controls="collapsedata">
<span class="badge badge-dark">Titanic data</span>
</div>
<div class="collapse" id="collapsedata">
<div class="card-body">
<p class="card-text">

This tutorial uses the Titanic data set, stored as CSV. The data
consists of the following data columns:

- PassengerId: Id of every passenger.
- Survived: This feature have value 0 and 1. 0 for not survived and 1
for survived.
- Pclass: There are 3 classes: Class 1, Class 2 and Class 3.
- Name: Name of passenger.
- Sex: Gender of passenger.
- Age: Age of passenger.
- SibSp: Indication that passenger have siblings and spouse.
- Parch: Whether a passenger is alone or have family.
- Ticket: Ticket number of passenger.
- Fare: Indicating the fare.
- Cabin: The cabin of passenger.
- Embarked: The embarked category.

.. raw:: html

</p>
<a href="https://github.com/pandas-dev/pandas/tree/master/doc/data/titanic.csv" class="btn btn-dark btn-sm">To raw data</a>
</div>
</div>