Skip to content

Commit 729c522

Browse files
authored
DOC: make a shared include for describing the Titanic data
Just a refactor; the net result should be the same.
1 parent f58d815 commit 729c522

File tree

6 files changed

+50
-154
lines changed

6 files changed

+50
-154
lines changed

doc/source/getting_started/intro_tutorials/02_read_write.rst

+4-29
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,13 @@
1616
</div>
1717
<ul class="list-group list-group-flush">
1818
<li class="list-group-item">
19-
<div data-toggle="collapse" href="#collapsedata" role="button" aria-expanded="false" aria-controls="collapsedata">
20-
<span class="badge badge-dark">Titanic data</span>
21-
</div>
22-
<div class="collapse" id="collapsedata">
23-
<div class="card-body">
24-
<p class="card-text">
25-
26-
This tutorial uses the Titanic data set, stored as CSV. The data
27-
consists of the following data columns:
28-
29-
- PassengerId: Id of every passenger.
30-
- Survived: This feature have value 0 and 1. 0 for not survived and 1
31-
for survived.
32-
- Pclass: There are 3 classes: Class 1, Class 2 and Class 3.
33-
- Name: Name of passenger.
34-
- Sex: Gender of passenger.
35-
- Age: Age of passenger.
36-
- SibSp: Indication that passenger have siblings and spouse.
37-
- Parch: Whether a passenger is alone or have family.
38-
- Ticket: Ticket number of passenger.
39-
- Fare: Indicating the fare.
40-
- Cabin: The cabin of passenger.
41-
- Embarked: The embarked category.
19+
20+
.. include:: titanic.rst
4221

4322
.. raw:: html
4423

45-
</p>
46-
<a href="https://github.com/pandas-dev/pandas/tree/master/doc/data/titanic.csv" class="btn btn-dark btn-sm">To raw data</a>
47-
</div>
48-
</div>
49-
</li>
50-
</ul>
24+
</li>
25+
</ul>
5126
</div>
5227

5328
How do I read and write tabular data?

doc/source/getting_started/intro_tutorials/03_subset_data.rst

+3-31
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,8 @@
1616
</div>
1717
<ul class="list-group list-group-flush">
1818
<li class="list-group-item">
19-
<div data-toggle="collapse" href="#collapsedata" role="button" aria-expanded="false" aria-controls="collapsedata">
20-
<span class="badge badge-dark">Titanic data</span>
21-
</div>
22-
<div class="collapse" id="collapsedata">
23-
<div class="card-body">
24-
<p class="card-text">
25-
26-
This tutorial uses the Titanic data set, stored as CSV. The data
27-
consists of the following data columns:
28-
29-
- PassengerId: Id of every passenger.
30-
- Survived: This feature has value 0 and 1. 0 for not survived and 1
31-
for survived.
32-
- Pclass: There are 3 classes: Class 1, Class 2 and Class 3.
33-
- Name: Name of passenger.
34-
- Sex: Gender of passenger.
35-
- Age: Age of passenger.
36-
- SibSp: Indication that passengers have siblings and spouses.
37-
- Parch: Whether a passenger is alone or has a family.
38-
- Ticket: Ticket number of passenger.
39-
- Fare: Indicating the fare.
40-
- Cabin: The cabin of passenger.
41-
- Embarked: The embarked category.
4219

43-
.. raw:: html
44-
45-
</p>
46-
<a href="https://github.com/pandas-dev/pandas/tree/master/doc/data/titanic.csv" class="btn btn-dark btn-sm">To raw data</a>
47-
</div>
48-
</div>
20+
.. include:: titanic.rst
4921

5022
.. ipython:: python
5123
@@ -54,8 +26,8 @@ consists of the following data columns:
5426
5527
.. raw:: html
5628

57-
</li>
58-
</ul>
29+
</li>
30+
</ul>
5931
</div>
6032

6133
How do I select a subset of a ``DataFrame``?

doc/source/getting_started/intro_tutorials/06_calculate_statistics.rst

+3-31
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,8 @@
1616
</div>
1717
<ul class="list-group list-group-flush">
1818
<li class="list-group-item">
19-
<div data-toggle="collapse" href="#collapsedata" role="button" aria-expanded="false" aria-controls="collapsedata">
20-
<span class="badge badge-dark">Titanic data</span>
21-
</div>
22-
<div class="collapse" id="collapsedata">
23-
<div class="card-body">
24-
<p class="card-text">
25-
26-
This tutorial uses the Titanic data set, stored as CSV. The data
27-
consists of the following data columns:
28-
29-
- PassengerId: Id of every passenger.
30-
- Survived: This feature have value 0 and 1. 0 for not survived and 1
31-
for survived.
32-
- Pclass: There are 3 classes: Class 1, Class 2 and Class 3.
33-
- Name: Name of passenger.
34-
- Sex: Gender of passenger.
35-
- Age: Age of passenger.
36-
- SibSp: Indication that passenger have siblings and spouse.
37-
- Parch: Whether a passenger is alone or have family.
38-
- Ticket: Ticket number of passenger.
39-
- Fare: Indicating the fare.
40-
- Cabin: The cabin of passenger.
41-
- Embarked: The embarked category.
4219

43-
.. raw:: html
44-
45-
</p>
46-
<a href="https://github.com/pandas-dev/pandas/tree/master/doc/data/titanic.csv" class="btn btn-dark btn-sm">To raw data</a>
47-
</div>
48-
</div>
20+
.. include:: titanic.rst
4921

5022
.. ipython:: python
5123
@@ -54,8 +26,8 @@ consists of the following data columns:
5426
5527
.. raw:: html
5628

57-
</li>
58-
</ul>
29+
</li>
30+
</ul>
5931
</div>
6032

6133
How to calculate summary statistics?

doc/source/getting_started/intro_tutorials/07_reshape_table_layout.rst

+3-31
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,8 @@
1616
</div>
1717
<ul class="list-group list-group-flush">
1818
<li class="list-group-item">
19-
<div data-toggle="collapse" href="#collapsedata" role="button" aria-expanded="false" aria-controls="collapsedata">
20-
<span class="badge badge-dark">Titanic data</span>
21-
</div>
22-
<div class="collapse" id="collapsedata">
23-
<div class="card-body">
24-
<p class="card-text">
25-
26-
This tutorial uses the Titanic data set, stored as CSV. The data
27-
consists of the following data columns:
28-
29-
- PassengerId: Id of every passenger.
30-
- Survived: This feature have value 0 and 1. 0 for not survived and 1
31-
for survived.
32-
- Pclass: There are 3 classes: Class 1, Class 2 and Class 3.
33-
- Name: Name of passenger.
34-
- Sex: Gender of passenger.
35-
- Age: Age of passenger.
36-
- SibSp: Indication that passenger have siblings and spouse.
37-
- Parch: Whether a passenger is alone or have family.
38-
- Ticket: Ticket number of passenger.
39-
- Fare: Indicating the fare.
40-
- Cabin: The cabin of passenger.
41-
- Embarked: The embarked category.
4219

43-
.. raw:: html
44-
45-
</p>
46-
<a href="https://github.com/pandas-dev/pandas/tree/master/doc/data/titanic.csv" class="btn btn-dark btn-sm">To raw data</a>
47-
</div>
48-
</div>
20+
.. include:: titanic.rst
4921

5022
.. ipython:: python
5123
@@ -108,8 +80,8 @@ measurement.
10880
10981
.. raw:: html
11082

111-
</li>
112-
</ul>
83+
</li>
84+
</ul>
11385
</div>
11486

11587
How to reshape the layout of tables?

doc/source/getting_started/intro_tutorials/10_text_data.rst

+3-32
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,7 @@
1616
</div>
1717
<ul class="list-group list-group-flush">
1818
<li class="list-group-item">
19-
<div data-toggle="collapse" href="#collapsedata" role="button" aria-expanded="false" aria-controls="collapsedata">
20-
<span class="badge badge-dark">Titanic data</span>
21-
</div>
22-
<div class="collapse" id="collapsedata">
23-
<div class="card-body">
24-
<p class="card-text">
25-
26-
This tutorial uses the Titanic data set, stored as CSV. The data
27-
consists of the following data columns:
28-
29-
- PassengerId: Id of every passenger.
30-
- Survived: This feature have value 0 and 1. 0 for not survived and 1
31-
for survived.
32-
- Pclass: There are 3 classes: Class 1, Class 2 and Class 3.
33-
- Name: Name of passenger.
34-
- Sex: Gender of passenger.
35-
- Age: Age of passenger.
36-
- SibSp: Indication that passenger have siblings and spouse.
37-
- Parch: Whether a passenger is alone or have family.
38-
- Ticket: Ticket number of passenger.
39-
- Fare: Indicating the fare.
40-
- Cabin: The cabin of passenger.
41-
- Embarked: The embarked category.
42-
43-
.. raw:: html
44-
45-
</p>
46-
<a href="https://github.com/pandas-dev/pandas/tree/master/doc/data/titanic.csv" class="btn btn-dark btn-sm">To raw data</a>
47-
</div>
48-
</div>
19+
.. include:: titanic.rst
4920

5021
.. ipython:: python
5122
@@ -54,8 +25,8 @@ consists of the following data columns:
5425
5526
.. raw:: html
5627

57-
</li>
58-
</ul>
28+
</li>
29+
</ul>
5930
</div>
6031

6132
How to manipulate textual data?
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
:orphan:
2+
3+
.. raw:: html
4+
5+
<div data-toggle="collapse" href="#collapsedata" role="button" aria-expanded="false" aria-controls="collapsedata">
6+
<span class="badge badge-dark">Titanic data</span>
7+
</div>
8+
<div class="collapse" id="collapsedata">
9+
<div class="card-body">
10+
<p class="card-text">
11+
12+
This tutorial uses the Titanic data set, stored as CSV. The data
13+
consists of the following data columns:
14+
15+
- PassengerId: Id of every passenger.
16+
- Survived: This feature have value 0 and 1. 0 for not survived and 1
17+
for survived.
18+
- Pclass: There are 3 classes: Class 1, Class 2 and Class 3.
19+
- Name: Name of passenger.
20+
- Sex: Gender of passenger.
21+
- Age: Age of passenger.
22+
- SibSp: Indication that passenger have siblings and spouse.
23+
- Parch: Whether a passenger is alone or have family.
24+
- Ticket: Ticket number of passenger.
25+
- Fare: Indicating the fare.
26+
- Cabin: The cabin of passenger.
27+
- Embarked: The embarked category.
28+
29+
.. raw:: html
30+
31+
</p>
32+
<a href="https://github.com/pandas-dev/pandas/tree/master/doc/data/titanic.csv" class="btn btn-dark btn-sm">To raw data</a>
33+
</div>
34+
</div>

0 commit comments

Comments
 (0)