Bases: cf.variablelist.VariableList
An ordered sequence of coordinates stored in a list-like object.
In some contexts, whether an object is a coordinate or a coordinate list is not known and does not matter. So to avoid ungainly type testing, some aspects of the CoordinateList interface are shared by a coordinate and vice versa.
Any attribute or method belonging to a coordinate may be used on a coordinate list and will be applied independently to each element.
Just as it is straight forward to iterate over the coordinates in a coordinate list, a coordinate will behave like a single element coordinate list in iterative and indexing contexts.
Initialization
Parameters : |
|
---|
Return a deep copy.
Equivalent to copy.deepcopy(s).
Returns : |
|
---|
Examples
>>> s.copy()
Return the number of occurrences of a given value.
Parameters : |
|
---|---|
Returns : |
|
Examples
>>> s
[1, 2, 3, 2, 4, 2]
>>> s.count(1)
1
>>> s.count(2)
3
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.
True if two instances are logically equal, False otherwise.
Parameters : |
|
---|---|
Returns : |
|
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.
Return the first index of a given value.
Parameters : | value : start : int, optional stop : int, optional |
---|---|
Returns : | out : int |
Raises : |
|
Examples
>>> s
[1, 2, 3, 2, 4, 2]
>>> s.index(1)
1
>>> s.index(2, start=2)
3
>>> s.index(2, start=2, stop=4)
3
Insert an object before the given index in place.
Parameters : | index : int object : |
---|---|
Returns : | None |
Examples
>>> s
[1, 2, 3]
>>> s.insert(1, 'A')
>>> s
[1, 'A', 2, 3]
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)>]