File tree 1 file changed +6
-5
lines changed 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -5468,12 +5468,13 @@ def head(self, n: int = 5) -> Self:
5468
5468
"""
5469
5469
Return the first `n` rows.
5470
5470
5471
- This function returns the first `n` rows for the object based
5472
- on position. It is useful for quickly testing if your object
5473
- has the right type of data in it.
5471
+ This function exhibits the same behavior as ``df[:n]``, returning the
5472
+ first ``n`` rows based on position. It is useful for quickly checking
5473
+ if your object has the right type of data in it.
5474
5474
5475
- For negative values of `n`, this function returns all rows except
5476
- the last `|n|` rows, equivalent to ``df[:n]``.
5475
+ When ``n`` is positive, it returns the first ``n`` rows. For ``n`` equal to 0,
5476
+ it returns an empty object. When ``n`` is negative, it returns
5477
+ all rows except the last ``|n|`` rows, mirroring the behavior of ``df[:n]``.
5477
5478
5478
5479
If n is larger than the number of rows, this function returns all rows.
5479
5480
You can’t perform that action at this time.
0 commit comments