Dataset Head¶
-
head
(tableName, rows=5)¶ Returns top rows of a given dataset.
Parameters: - tableName: string
The name of table associated with the dataset. A full list of table names can be found in the Data Catalog or Datasets method.
- rows: int, default: 5
Number of top rows to be returned (default 5).
Returns: Pandas dataframe.
Example
Retrieves the top five rows of the Falkor 2018 cruise dataset.
#!pip install pycmap -q #uncomment to install pycmap, if necessary
import pycmap
api = pycmap.API(token='<YOUR_API_KEY>')
api.head('tblFalkor_2018')
SQL Statement
Here is how to achieve the same results using a direct SQL statement. Please refer to Query for more information.
EXEC uspHead 'tableName', 'rows'
Example
Retrieves the top five rows of the Falkor 2018 cruise dataset.
EXEC uspHead 'tblFalkor_2018', '5'