If Column Exists¶
-
has_field
(tableName, varName)¶ Returns True if the specified column (field) exists in the table Returns False if either table or variable does not exist (also see Dataset Columns).
Parameters: - tableName: string
The name of table associated with the dataset. A full list of table names can be found in the Data Catalog.
- varName: string or list of string
Variable short name. A full list of variable short names can be found in the Data Catalog.
Returns: Boolean
Example
#!pip install pycmap -q #uncomment to install pycmap, if necessary
import pycmap
api = pycmap.API(token='<YOUR_API_KEY>')
api.has_field('tblAltimetry_REP', 'sla')