Skip to content

Commit 6dcd18f

Browse files
committed
DOC: define tips variable to avoid flake8-rst error
1 parent cce169a commit 6dcd18f

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

doc/source/getting_started/comparison/includes/filtering.rst

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
DataFrames can be filtered in multiple ways; the most intuitive of which is using
44
:ref:`boolean indexing <indexing.boolean>`
55

6+
.. ipython:: python
7+
:suppress:
8+
9+
# ensure tips is defined when scanning with flake8-rst
10+
if 'tips' not in vars():
11+
tips = {}
12+
613
.. ipython:: python
714
815
tips[tips["total_bill"] > 10]

doc/source/getting_started/comparison/includes/if_then.rst

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
The same operation in pandas can be accomplished using
44
the ``where`` method from ``numpy``.
55

6+
.. ipython:: python
7+
:suppress:
8+
9+
# ensure tips is defined when scanning with flake8-rst
10+
if 'tips' not in vars():
11+
tips = {}
12+
613
.. ipython:: python
714
815
tips["bucket"] = np.where(tips["total_bill"] < 10, "low", "high")

doc/source/getting_started/comparison/includes/sorting.rst

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
pandas objects have a :meth:`DataFrame.sort_values` method, which
44
takes a list of columns to sort by.
55

6+
.. ipython:: python
7+
:suppress:
8+
9+
# ensure tips is defined when scanning with flake8-rst
10+
if 'tips' not in vars():
11+
tips = {}
12+
613
.. ipython:: python
714
815
tips = tips.sort_values(["sex", "total_bill"])

doc/source/getting_started/comparison/includes/time_date.rst

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
:orphan:
22

3+
.. ipython:: python
4+
:suppress:
5+
6+
# ensure tips is defined when scanning with flake8-rst
7+
if 'tips' not in vars():
8+
tips = {}
9+
310
.. ipython:: python
411
512
tips["date1"] = pd.Timestamp("2013-01-15")

0 commit comments

Comments
 (0)