cf.set

cf.set(values, units=None)[source]

Return an object for testing whether a variable equals any element of a collection.

Parameters :

values : scalar or sequence

units : str or cf.Units, optional

If applicable, the units of values. By default, the same units as the variable being tested are assumed.

Returns :
out : cf.Comparison

A cf.Comparison object which will evaluate whether or not the comparison evaluates to True.

Examples

>>> c = cf.set([3, 5])
>>> c
<CF Comparison: set [3, 5]>
>>> 4 == c
False
>>> 5 == c
True
>>> c = cf.set(4)
>>> c
<CF Comparison: set (4,)>
>>> 4 == c
True

Previous topic

cf.ne

Next topic

cf.wi

This Page