DOC: Document behaviour of head(n), tail(n) for negative values of n except on GroupBy
State: closed

- [x] xref #30192 
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Output of `python3 scripts/validate_docstrings.py pandas.DataFrame.head`

```bash
################################################################################
###################### Docstring (pandas.DataFrame.head)  ######################
################################################################################

Return the first `n` rows.

This function returns the first `n` rows for the object based
on position. It is useful for quickly testing if your object
has the right type of data in it.

For negative values of `n`, this function returns all rows except
the last `n` rows, equivalent to ``df[:-n]``.

Parameters
----------
n : int, default 5
    Number of rows to select.

Returns
-------
same type as caller
    The first `n` rows of the caller object.

See Also
--------
DataFrame.tail: Returns the last `n` rows.

Examples
--------
>>> df = pd.DataFrame({'animal': ['alligator', 'bee', 'falcon', 'lion',
...                    'monkey', 'parrot', 'shark', 'whale', 'zebra']})
>>> df
      animal
0  alligator
1        bee
2     falcon
3       lion
4     monkey
5     parrot
6      shark
7      whale
8      zebra

Viewing the first 5 lines

>>> df.head()
      animal
0  alligator
1        bee
2     falcon
3       lion
4     monkey

Viewing the first `n` lines (three in this case)

>>> df.head(3)
      animal
0  alligator
1        bee
2     falcon

For negative values of `n`

>>> df.head(-3)
      animal
0  alligator
1        bee
2     falcon
3       lion
4     monkey
5     parrot

################################################################################
################################## Validation ##################################
################################################################################

Docstring for "pandas.DataFrame.head" correct. :)
```

Output of `python3 scripts/validate_docstrings.py pandas.DataFrame.tail`

```bash
################################################################################
###################### Docstring (pandas.DataFrame.tail)  ######################
################################################################################

Return the last `n` rows.

This function returns last `n` rows from the object based on
position. It is useful for quickly verifying data, for example,
after sorting or appending rows.

For negative values of `n`, this function returns all rows except
the first `n` rows, equivalent to ``df[n:]``.

Parameters
----------
n : int, default 5
    Number of rows to select.

Returns
-------
type of caller
    The last `n` rows of the caller object.

See Also
--------
DataFrame.head : The first `n` rows of the caller object.

Examples
--------
>>> df = pd.DataFrame({'animal': ['alligator', 'bee', 'falcon', 'lion',
...                    'monkey', 'parrot', 'shark', 'whale', 'zebra']})
>>> df
      animal
0  alligator
1        bee
2     falcon
3       lion
4     monkey
5     parrot
6      shark
7      whale
8      zebra

Viewing the last 5 lines

>>> df.tail()
   animal
4  monkey
5  parrot
6   shark
7   whale
8   zebra

Viewing the last `n` lines (three in this case)

>>> df.tail(3)
  animal
6  shark
7  whale
8  zebra

For negative values of `n`

>>> df.tail(-3)
   animal
3    lion
4  monkey
5  parrot
6   shark
7   whale
8   zebra

################################################################################
################################## Validation ##################################
################################################################################

Docstring for "pandas.DataFrame.tail" correct. :)
```

Output of `./ci/code_checks.sh doctests` passed for `groupby.py`

Labels:
name: Docs
name: Groupby

Comments:
@Bharat123rox can you verify that we have unit tests for negative values in DataFrame.head?
We do have the unit tests 👍, so this is the expected behaviour I guess...
 
https://github.com/pandas-dev/pandas/blob/a2bbdb5a0abd131d0190fe58c0ba7cbf21b960c9/pandas/tests/generic/test_generic.py#L306-L308
Thanks!