cf.FieldList.equals¶
-
FieldList.
equals
(other, rtol=None, atol=None, ignore_fill_value=False, traceback=False, ignore=(), _set=False)[source]¶ True if two field lists are equal, False otherwise.
Two {+variable}s are equal if they have the same number of elements and the field elements are equal pairwise, i.e.
f.equals(g)
is equivalent toall(x.equals(y) for x, y in map(None, f, g))
.Two fields are equal if ...
Note that a single element {+variable} may be equal to field, for example
f[0:1].equals(f[0])
andf[0].equals(f[0:1])
are always True.See also
set_equals
,cf.Field.equals
Examples 1: >>> b = f.equals(g)
Parameters: - other:
object
The object to compare for equality.
{+atol}
{+rtol}
- ignore_fill_value:
bool
, optional If True then data arrays with different fill values are considered equal. By default they are considered unequal.
- traceback:
bool
, optional If True then print a traceback highlighting where the two {+variable}s differ.
- ignore:
tuple
, optional The names of CF properties to omit from the comparison. By default, the CF Conventions property is omitted.
Returns: - out:
bool
Whether or not the two {+variable}s are equal.
Examples 2: See also
Examples 1: >>> g = f.copy() >>> g.equals(f) True
- other: