@@ -389,11 +389,16 @@ index are the group names and whose values are the sizes of each group.
389
389
390
390
.. note ::
391
391
392
- Aggregation functions will **not ** return the groups that you are aggregating over
393
- if they are named *columns *. The grouped columns will be the **indices ** of the returned object.
392
+ Aggregation functions **will not ** return the groups that you are aggregating over
393
+ if they are named *columns *, when ``as_index=True ``, the default. The grouped columns will
394
+ be the **indices ** of the returned object.
395
+
396
+ Passing ``as_index=False `` **will ** return the groups that you are aggregating over, if they are
397
+ named *columns *.
398
+
394
399
Aggregating functions are ones that reduce the dimension of the returned objects,
395
400
for example: ``mean, sum, size, count, std, var, describe, first, last, min, max ``. This is
396
- very much like performing a redcing operation on a ``DataFrame `` and getting a ``Series `` back .
401
+ what happens when you do for example ``DataFrame.sum() `` and get back a ``Series ``.
397
402
398
403
.. _groupby.aggregate.multifunc :
399
404
@@ -552,7 +557,9 @@ and that the transformed data contains no NAs.
552
557
.. note ::
553
558
554
559
Some functions when applied to a groupby object will automatically transform the input, returning
555
- an object of the same shape as the original. For example: ``fillna, ffill, bfill, shift ``.
560
+ an object of the same shape as the original. Passing ``as_index=False `` will not affect these transformation methods.
561
+
562
+ For example: ``fillna, ffill, bfill, shift ``.
556
563
557
564
.. ipython :: python
558
565
@@ -604,6 +611,8 @@ For dataframes with multiple columns, filters should explicitly specify a column
604
611
605
612
Some functions when applied to a groupby object will act as a **filter ** on the input, returning
606
613
a reduced shape of the original (and potentitally eliminating groups), but with the index unchanged.
614
+ Passing ``as_index=False `` will not affect these transformation methods.
615
+
607
616
For example: ``head, tail nth ``.
608
617
609
618
.. ipython :: python
0 commit comments