DOC: Minor fix to docstring formatting for `head()` and `tail()`
Fix minor inconsistency in docstring formatting for `head()` and `tail()`.

Fix the code formatting for the `n` variable appearing in the docstrings of `head()` and `tail()` so that it is consistent with surrounding uses of the variable.
Thanks @albanie 