cf.Field.select

Field.select(*args, **kwargs)[source]

Return the field if it satisfies the given conditions.

f.select(*args, **kwargs) is equivalent to f if f.match(*args, **kwargs) else cf.FieldList().

See cf.Field.match for details.

Parameters :
args, kwargs : optional

See cf.Field.match.

Returns :
out : cf.Field or cf.FieldList

If the field matches the given conditions then it is returned as an object identity. Otherwise an empty field list is returned.

Examples

Select the field if has exactly four domain axes:

>>> f.select(rank=4)

See cf.Field.match for further examples.

Previous topic

cf.Field.remove_items

Next topic

cf.Field.setattr

This Page