Bases: cf.utils.CfList
An ordered sequence of variables stored in a list-like object.
In some contexts, whether an object is a variable or a variable list is not known and does not matter. So to avoid ungainly type testing, some aspects of the VariableList interface are shared by a variable and vice versa.
Any attribute or method belonging to a variable may be used on a variable list and will be applied independently to each element.
Just as it is straight forward to iterate over the variables in a variable list, a variable will behave like a single element variable list in iterative and indexing contexts.
Initialization
Parameters : |
|
---|
Return a deep copy.
Equivalent to copy.deepcopy(x)
Returns : |
|
---|
Examples
>>> x.copy()
Uses numerically tolerant equality.
Delete a public attribute from each element of the list of variables.
Return a string containing the full descriptions of each variable in the list.
See also
Return True if two lists are congruent in that
- Each pair of their elements are equal.
- Both instances have equal attributes.
Numerical equality is to within a tolerance. Refer to cf for details.
Parameters: |
|
---|---|
Returns: | True if the two objects are congruent, False otherwise. |
Return the elements which match the given conditions.
The match conditions are passed to each element’s match method in turn.
Parameters : | |
---|---|
Returns : |
|
Examples
>>> f
[<>
<>]
>>> f.extract(attr={'standard_name': 'air_temperature'})
[<>]
Return a built-in list of the public attributes of each element of the list of variables.
Return a built-in list of the public attributes of each element of the list of variables.
Uses numerically tolerant equality.
CFL.insert(index, object) – insert object before index
Return a list of booleans showing which elements match the given conditions.
The match conditions are passed to each element’s match method in turn.
Parameters : | |
---|---|
Returns : |
|
Examples
>>> f
[<>
<>]
>>> f.match(attr={'standard_name': 'air_temperature'})
[True, False]
Return a built-in list of the names of each element of the list of variables.
Set a public attribute from each element of the list of variables.
Subset each variable in the list, returning a new list of variables.
Examples
>>> vl
[<CF Variable: air_temperature(73, 96)>,
<CF Variable: air_temperature(73, 96)>]
>>> vl.subset[0,0]
[<CF Variable: air_temperature(1,1)>,
<CF Variable: air_temperature(1,1)>]