Skip to content

Commit

Permalink
Added note explaining version 0.20 change and ambiguity resolution / …
Browse files Browse the repository at this point in the history
…warning
  • Loading branch information
Jon M. Mease committed Oct 27, 2016
1 parent 6a72cfa commit dea98f1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions doc/source/groupby.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,20 @@ The mapping can be specified many different ways:
course ``df.groupby('A')`` is just syntactic sugar for
``df.groupby(df['A'])``, but it makes life simpler
- For DataFrame objects, a string indicating an index level to be used to group.
If a string matches both an index level name and a column name then the column
takes precedence
- A list of any of the above things

Collectively we refer to the grouping objects as the **keys**. For example,
consider the following DataFrame:

.. note::

.. versionadded:: 0.20

A string passed to ``groupby`` may refer to either a column or an index level.
If a string matches both a column and an index level then a warning is issued
and the column takes precedence. This will result in an ambiguity error in a
future version.

.. ipython:: python
df = pd.DataFrame({'A' : ['foo', 'bar', 'foo', 'bar',
Expand Down

0 comments on commit dea98f1

Please sign in to comment.