cf.VariableList

class cf.VariableList(sequence=())[source]

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 :
sequence : iterable, optional

Define a new list with these elements.

VariableList attributes

subspace Subspace each variable in the list, returning a new list of variables.

VariableList methods

append
copy Return a deep copy.
count Return the number of occurrences of a given value.
delprop Delete a CF property from each element of the list.
dump Return a string containing the full descriptions of each variable in
equals True if two instances are equal, False otherwise.
extend
getprop Return a built-in list of a CF properties from each element.
hasprop Return a built-in list describing whether each element has a CF
index Return the first index of a given value.
insert Insert an object before the given index in place.
match Return a list of booleans showing which elements match the given conditions.
name Return a built-in list of the names of each element of the list of
override_units Override the each element’s data array units in place.
pop
remove
reverse
select Return the elements which match the given conditions.
set_equals True if two instances are set-wise equal, False otherwise.
setprop Set a CF property on each element of the list.
sort Sort the elements in place.
subspace Subspace each variable in the list, returning a new list of variables.

Table Of Contents

Previous topic

cf.Variable.transpose

Next topic

cf.VariableList.subspace

This Page