Variable Stat¶
-
get_var_stat
(tableName, varName)¶ Returns summary statistics involving the min, max, mean, standard deviation, count, and quantiles for the given variable.
Parameters: - tableName: string
The name of table associated with the dataset. A full list of table names can be found in the Data Catalog.
- variable: string or list of string
Variable short name. A full list of variable short names can be found in the Data Catalog.
Returns: Pandas dataframe.
Example
Returns summary statistics for the short name variable, Prochlorococcus, in the HOT LAVA Cruise dataset.
#!pip install pycmap -q #uncomment to install pycmap, if necessary
import pycmap
api = pycmap.API(token='<YOUR_API_KEY>')
api.get_var_stat('tblHOT_LAVA', 'Prochlorococcus')
SQL Statement
Here is how to achieve the same results using a direct SQL statement. Please refer to Query for more information.
EXEC uspVariableStat 'tableName', 'varName'
Example
Returns summary statistics for the short name variable, Prochlorococcus, in the HOT LAVA Cruise dataset.
EXEC uspVariableStat 'tblHOT_LAVA', 'Prochlorococcus'