Contents Menu Expand Light mode Dark mode Auto light/dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Sloth 1.0 documentation
Sloth 1.0 documentation
  • Frame
    • DataFrame
      • from_pandas
      • to_pandas
      • reindex
    • Series
      • to_pandas
    • astype
    • iterrows
    • to_numpy
    • resample
    • rolling
    • plot
    • tail
    • head
    • iloc
    • loc
    • iat
  • Index
    • ObjectIndex
      • get_item
      • to_pandas
    • RangeIndex
      • to_pandas
    • PeriodIndex
      • to_pandas
    • DateTimeIndex
      • to_pandas
      • get_item
  • Indexer
    • IntegerLocation
    • Location
    • iAT
    • calculate_index
  • Resampler
    • mean
    • sum
  • Rolling
    • mean
    • sum
    • min
    • max
Back to top
View this page

head¶

Frame.head(n=5)¶

Return the first n rows of the frame.

This function returns the first n rows of the frame, based on the number of rows specified by the n parameter. If n is not provided, it defaults to 5. It is useful for quickly inspecting the head of a frame for large datasets.

Parameters¶

nint, optional

Number of rows to return. Defaults to 5.

Returns¶

Frame

A new Frame instance containing the first n rows.

See Also¶

Frame.tail : Returns the last n rows.

Examples¶

>>> frame = Frame(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]))
>>> frame.head(2)
array([[1, 2, 3],
        [4, 5, 6]])
Next
iloc
Previous
tail
Copyright ©
Made with Sphinx and @pradyunsg's Furo
On this page
  • head
    • Frame.head()