Skip to content

Commit 47dd6f4

Browse files
committed
DOC: make shared include for filtering for comparison pages
1 parent d264a8a commit 47dd6f4

File tree

4 files changed

+22
-29
lines changed

4 files changed

+22
-29
lines changed

doc/source/getting_started/comparison/comparison_with_sas.rst

+1-6
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,7 @@ or more columns.
223223
DATA step begins and can also be used in PROC statements */
224224
run;
225225
226-
DataFrames can be filtered in multiple ways; the most intuitive of which is using
227-
:ref:`boolean indexing <indexing.boolean>`
228-
229-
.. ipython:: python
230-
231-
tips[tips["total_bill"] > 10].head()
226+
.. include:: filtering.rst
232227

233228
If/then logic
234229
~~~~~~~~~~~~~

doc/source/getting_started/comparison/comparison_with_sql.rst

+2-17
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,9 @@ Filtering in SQL is done via a WHERE clause.
7373
7474
SELECT *
7575
FROM tips
76-
WHERE time = 'Dinner'
77-
LIMIT 5;
78-
79-
DataFrames can be filtered in multiple ways; the most intuitive of which is using
80-
:ref:`boolean indexing <indexing.boolean>`
81-
82-
.. ipython:: python
83-
84-
tips[tips["time"] == "Dinner"].head(5)
85-
86-
The above statement is simply passing a ``Series`` of True/False objects to the DataFrame,
87-
returning all rows with True.
88-
89-
.. ipython:: python
76+
WHERE time = 'Dinner';
9077
91-
is_dinner = tips["time"] == "Dinner"
92-
is_dinner.value_counts()
93-
tips[is_dinner].head(5)
78+
.. include:: filtering.rst
9479

9580
Just like SQL's OR and AND, multiple conditions can be passed to a DataFrame using | (OR) and &
9681
(AND).

doc/source/getting_started/comparison/comparison_with_stata.rst

+1-6
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,7 @@ Filtering in Stata is done with an ``if`` clause on one or more columns.
217217
218218
list if total_bill > 10
219219
220-
DataFrames can be filtered in multiple ways; the most intuitive of which is using
221-
:ref:`boolean indexing <indexing.boolean>`.
222-
223-
.. ipython:: python
224-
225-
tips[tips["total_bill"] > 10].head()
220+
.. include:: filtering.rst
226221

227222
If/then logic
228223
~~~~~~~~~~~~~
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
:orphan:
2+
3+
DataFrames can be filtered in multiple ways; the most intuitive of which is using
4+
:ref:`boolean indexing <indexing.boolean>`
5+
6+
.. ipython:: python
7+
8+
tips[tips["total_bill"] > 10]
9+
10+
The above statement is simply passing a ``Series`` of ``True``/``False`` objects to the DataFrame,
11+
returning all rows with ``True``.
12+
13+
.. ipython:: python
14+
15+
is_dinner = tips["time"] == "Dinner"
16+
is_dinner
17+
is_dinner.value_counts()
18+
tips[is_dinner]

0 commit comments

Comments
 (0)