next up previous index
Next: Interaction Sets Up: Datasets Previous: Attribute Box   Index


Subsets of Dataset

Opus implements a child class of Dataset, called DatasetSubset, which allows to define a subset of a dataset. Conceptually, it is a viewing window for the parent Dataset object, not a copy. Thus, any change in the parent object is seen by the child.

It is initialized by passing the parent object and an index to the constructor. The index determines indices of elements within the parent object that should be seen. Any call of get_attribute() on the subset returns values corresponding to the index. A subset can be also created using the Dataset method create_subset_window_by_ids(ids) called on the parent object.

Note that only methods for viewing attributes (such as get_attribute() or summary()) make sense for using with a subset. Other methods that would for example modify attributes (such as compute_variables()) could destroy the parent dataset.


next up previous index
Next: Interaction Sets Up: Datasets Previous: Attribute Box   Index
info (at) urbansim.org