Skip to content

Commit

Permalink
DOC: fix lint error around air_quality_no2 data
Browse files Browse the repository at this point in the history
Seems flake8-rst isn't able to handle a variable defined in an include.
  • Loading branch information
afeld committed Dec 27, 2020
1 parent 04d7b2d commit 23ebe80
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 34 deletions.
28 changes: 27 additions & 1 deletion doc/source/getting_started/intro_tutorials/04_plotting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,33 @@
import pandas as pd
import matplotlib.pyplot as plt
.. include:: air_quality_no2.rst
.. raw:: html

<div class="card gs-data">
<div class="card-header">
<div class="gs-data-title">
Data used for this tutorial:
</div>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">

. include:: air_quality_no2.rst

.. ipython:: python
air_quality = pd.read_csv("data/air_quality_no2.csv", index_col=0, parse_dates=True)
air_quality.head()
.. note::
The usage of the ``index_col`` and ``parse_dates`` parameters of the ``read_csv`` function to define the first (0th) column as
index of the resulting ``DataFrame`` and convert the dates in the column to :class:`Timestamp` objects, respectively.

.. raw:: html

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

How to create plots in pandas?
------------------------------
Expand Down
24 changes: 23 additions & 1 deletion doc/source/getting_started/intro_tutorials/05_add_columns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,29 @@
import pandas as pd
.. include:: air_quality_no2.rst
.. raw:: html

<div class="card gs-data">
<div class="card-header">
<div class="gs-data-title">
Data used for this tutorial:
</div>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">

. include:: air_quality_no2.rst

.. ipython:: python
air_quality = pd.read_csv("data/air_quality_no2.csv", index_col=0, parse_dates=True)
air_quality.head()
.. raw:: html

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

How to create new columns derived from existing columns?
--------------------------------------------------------
Expand Down
41 changes: 9 additions & 32 deletions doc/source/getting_started/intro_tutorials/air_quality_no2.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
.. raw:: html

<div class="card gs-data">
<div class="card-header">
<div class="gs-data-title">
Data used for this tutorial:
</div>
</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">
<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
Expand All @@ -24,22 +16,7 @@ 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>

.. ipython:: python
air_quality = pd.read_csv("data/air_quality_no2.csv", index_col=0, parse_dates=True)
air_quality.head()
.. note::
The usage of the ``index_col`` and ``parse_dates`` parameters of the ``read_csv`` function to define the first (0th) column as
index of the resulting ``DataFrame`` and convert the dates in the column to :class:`Timestamp` objects, respectively.

.. raw:: html

</li>
</ul>
</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>

0 comments on commit 23ebe80

Please sign in to comment.