cf.FieldList.iter

FieldList.iter(name, *args, **kwargs)[source]

Return an iterator over the results of a method applied to the field list.

fl.iter(name) is equivalent to iter(getattr(fl, name)()).

Parameters:
name : str

The name of the method to apply to each element.

args, kwargs : optional

The arguments to be used in the call to the named method.

Returns:
out : generator

An iterator over the results of the named method applied to each element.

See also

method

Examples:
>>> fl.getprop('standard_name')
['air_temperature', 'eastward_wind']
>>> for x in fl.iter('getprop', 'standard_name'):
...     print x
...
'air_temperature'
'eastward_wind'
>>> fl.iter('squeeze')
[None, None]

Previous topic

cf.FieldList.items

Next topic

cf.FieldList.mask_invalid

This Page