Navigation

  • index
  • modules |
  • next |
  • previous |
  • home| 
  • news| 
  • examples| 
  • downloads| 
  • docs| 
  • Documentation »
  • MeteoInfoLab »
  • The MeteoInfoLab API »
  • dataframe package »
  • mipylib.dataframe.dataframe »
  • DataFrame »
  • head

head¶

DataFrame.head(n=5)¶

Get top rows

Parameters

n – (int) row number.

Returns

Top rows

Examples:

>>> df = 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
Fork me on GitHub Join the chat at Gitter

Previous topic

append

Next topic

read_table

This Page

  • Show Source

Quick search

Navigation

  • index
  • modules |
  • next |
  • previous |
  • home| 
  • news| 
  • examples| 
  • downloads| 
  • docs| 
  • Documentation »
  • MeteoInfoLab »
  • The MeteoInfoLab API »
  • dataframe package »
  • mipylib.dataframe.dataframe »
  • DataFrame »
  • head
© Copyright 2010-2023, MeteoInfo developers. Created using Sphinx 3.2.1.