cf.Constructs.filter_by_key¶
-
Constructs.
filter_by_key
(*keys)[source]¶ Select metadata constructs by key.
New in version 1.7.0.
See also
filter_by_axis
,filter_by_data
,filter_by_measure
,filter_by_method
,filter_by_identity
,filter_by_naxes
,filter_by_ncdim
,filter_by_ncvar
,filter_by_property
,filter_by_type
,filters_applied
,inverse_filter
,unfilter
- Parameters
- keys: optional
Select constructs that have any of the given construct keys.
A key is specified by a string (e.g.
'fieldancillary0'
).If no keys are provided then all constructs are selected.
- Returns
Constructs
The selected constructs and their construct keys.
Examples:
Select the construct with key ‘domainancillary0’:
>>> d = c.filter_by_key('domainancillary0')
Select the constructs with keys ‘dimensioncoordinate1’ or ‘fieldancillary0’:
>>> d = c.filter_by_key('dimensioncoordinate1', 'fieldancillary0')