next up previous contents
Next: ColumnSupersetView Up: Views Previous: ColumnSubsetView   Contents

RowSupersetView

A SupersetView is the converse to a SubsetView. While the SubsetView reduces the size of a single dataset, the SupersetView combines datasets together to make one large, aggregate dataset. The RowSupersetView combines two datasets along their columns. That is, the rows of data in one dataset are appended to the rows of data in the other. A consequence of this, is that the number of columns in both datasets must be equal. A dataset may be appended to itself.

For an example, we will concatenate two, square datasets.

>>> ds1 = Dataset(MLab.rand(2,2))
>>> ds2 = Dataset(MLab.rand(2,2))
>>> ds1.getData()
[[ 0.12192474, 0.89563274,]
 [ 0.3412022 , 0.25135848,]]
>>> ds2.getData()
[[ 0.12337618, 0.9021067 ,]
 [ 0.4221943 , 0.98156619,]]
>>> ss1 = RowSupersetView(ds1, ds2)
>>> ss1.getData()
[[ 0.12192474, 0.89563274,]
 [ 0.3412022 , 0.25135848,]
 [ 0.12337618, 0.9021067 ,]
 [ 0.4221943 , 0.98156619,]]
>>> ss1.getColData(1)
[ 0.89563274, 0.25135848, 0.9021067 , 0.98156619,]



Lucas Scharenbroich 2003-08-27