Skip to content

Commit

Permalink
DOC: make a shared include for describing the Titanic data
Browse files Browse the repository at this point in the history
Just a refactor; the net result should be the same.
  • Loading branch information
afeld committed Dec 27, 2020
1 parent 6e18023 commit 2c4d43d
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 154 deletions.
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
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
32 changes: 32 additions & 0 deletions doc/source/getting_started/intro_tutorials/titanic.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.. 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>

0 comments on commit 2c4d43d

Please sign in to comment.