2 2 3.0 4 2 5.0 >>> g.nth(slice(None, -1)) A B 0 1 NaN 1 1 2.0 2 2 3.0 Index notation may also be used >>> g.nth[0, 1] A B 0 1 NaN 1 1 2.0 2 2 3.0 4 2 5.0 >>> g.nth[:-1] A B 0 1 NaN 1 1 2.0 2 2 3.0 Specifying `dropna` allows ignoring ``NaN`` values >>> g.nth(0, dropna='any') A B 1 1 2.0 2 2 3.0 When the specified ``n`` is larger than any of the groups, an empty DataFrame is returned >>> g.nth(3, dropna='any') Empty DataFrame Columns: [A, B] Index: [] )