Shortcuts

torcharrow.DataFrame.head

DataFrame.head(n=5)

返回前n行。

Parameters:

n (int) – 返回的行数。

另请参阅

icolumn.tail

返回最后n行。

示例

>>> import torcharrow as ta
>>> df = ta.dataframe({'a': list(range(7)),
>>>             'b': list(reversed(range(7))),
>>>             'c': list(range(7))
>>>            })
>>> df.head(2)
  index    a    b    c    d
-------  ---  ---  ---  ---
      0    0    6    0   99
      1    1    5    1  100
dtype: Struct([Field('a', int64), Field('b', int64), Field('c', int64), Field('d', int64)]), count: 2, null_count: 0