We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a57d59d commit eb49283Copy full SHA for eb49283
doc/source/groupby.rst
@@ -571,6 +571,13 @@ with NaNs.
571
572
dff.groupby('B').filter(lambda x: len(x) > 2, dropna=False)
573
574
+For dataframes with multiple columns, filters should explicitly specify a column as the filter criterion.
575
+
576
+.. ipython:: python
577
578
+ dff['C'] = np.arange(8)
579
+ dff.groupby('B').filter(lambda x: len(x['C']) > 2)
580
581
.. _groupby.dispatch:
582
583
Dispatching to instance methods
@@ -650,7 +657,7 @@ The dimension of the returned result can also change:
650
657
.. ipython:: python
651
658
652
659
def f(x):
653
- return Series([ x, x**2 ], index = ['x', 'x^s'])
660
+ return Series([ x, x**2 ], index = ['x', 'x^s'])
654
661
s = Series(np.random.rand(5))
655
662
s
656
663
s.apply(f)
0 commit comments