Skip to content

Commit bc6ab05

Browse files
mortadaTomAugspurger
authored andcommitted
DOC: fixed references to DataFrameGroupBy methods in comparison_with_…
…sql.rst Author: Mortada Mehyar <[email protected]> Closes #12491 from mortada/sql_docs and squashes the following commits: 5d4f520 [Mortada Mehyar] DOC: fixed references to DataFrameGroupBy methods in comparison_with_sql.rst
1 parent 41b1d25 commit bc6ab05

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

doc/source/api.rst

+7-4
Original file line numberDiff line numberDiff line change
@@ -1694,16 +1694,18 @@ application to columns of a specific data type.
16941694
.. autosummary::
16951695
:toctree: generated/
16961696

1697+
DataFrameGroupBy.agg
1698+
DataFrameGroupBy.all
1699+
DataFrameGroupBy.any
16971700
DataFrameGroupBy.bfill
1701+
DataFrameGroupBy.corr
1702+
DataFrameGroupBy.count
1703+
DataFrameGroupBy.cov
16981704
DataFrameGroupBy.cummax
16991705
DataFrameGroupBy.cummin
17001706
DataFrameGroupBy.cumprod
17011707
DataFrameGroupBy.cumsum
17021708
DataFrameGroupBy.describe
1703-
DataFrameGroupBy.all
1704-
DataFrameGroupBy.any
1705-
DataFrameGroupBy.corr
1706-
DataFrameGroupBy.cov
17071709
DataFrameGroupBy.diff
17081710
DataFrameGroupBy.ffill
17091711
DataFrameGroupBy.fillna
@@ -1717,6 +1719,7 @@ application to columns of a specific data type.
17171719
DataFrameGroupBy.rank
17181720
DataFrameGroupBy.resample
17191721
DataFrameGroupBy.shift
1722+
DataFrameGroupBy.size
17201723
DataFrameGroupBy.skew
17211724
DataFrameGroupBy.take
17221725
DataFrameGroupBy.tshift

doc/source/comparison_with_sql.rst

+8-7
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Getting items where ``col1`` IS NOT NULL can be done with :meth:`~pandas.Series.
138138
139139
GROUP BY
140140
--------
141-
In pandas, SQL's GROUP BY operations performed using the similarly named
141+
In pandas, SQL's GROUP BY operations are performed using the similarly named
142142
:meth:`~pandas.DataFrame.groupby` method. :meth:`~pandas.DataFrame.groupby` typically refers to a
143143
process where we'd like to split a dataset into groups, apply some function (typically aggregation)
144144
, and then combine the groups together.
@@ -163,23 +163,24 @@ The pandas equivalent would be:
163163
164164
tips.groupby('sex').size()
165165
166-
Notice that in the pandas code we used :meth:`~pandas.DataFrameGroupBy.size` and not
167-
:meth:`~pandas.DataFrameGroupBy.count`. This is because :meth:`~pandas.DataFrameGroupBy.count`
168-
applies the function to each column, returning the number of ``not null`` records within each.
166+
Notice that in the pandas code we used :meth:`~pandas.core.groupby.DataFrameGroupBy.size` and not
167+
:meth:`~pandas.core.groupby.DataFrameGroupBy.count`. This is because
168+
:meth:`~pandas.core.groupby.DataFrameGroupBy.count` applies the function to each column, returning
169+
the number of ``not null`` records within each.
169170

170171
.. ipython:: python
171172
172173
tips.groupby('sex').count()
173174
174-
Alternatively, we could have applied the :meth:`~pandas.DataFrameGroupBy.count` method to an
175-
individual column:
175+
Alternatively, we could have applied the :meth:`~pandas.core.groupby.DataFrameGroupBy.count` method
176+
to an individual column:
176177

177178
.. ipython:: python
178179
179180
tips.groupby('sex')['total_bill'].count()
180181
181182
Multiple functions can also be applied at once. For instance, say we'd like to see how tip amount
182-
differs by day of the week - :meth:`~pandas.DataFrameGroupBy.agg` allows you to pass a dictionary
183+
differs by day of the week - :meth:`~pandas.core.groupby.DataFrameGroupBy.agg` allows you to pass a dictionary
183184
to your grouped DataFrame, indicating which functions to apply to specific columns.
184185

185186
.. code-block:: sql

0 commit comments

Comments
 (0)