Bases: object
A hyperrectangular partition matrix of a master data array.
Each of elements (called partitions) span all or part of exactly one sub-array of the master data array.
A partition matrix is indexable in a similar way to numpy array apart from two important extensions to the numpy indexing functionality:
Initialization
Parameters : |
|
---|
Examples
>>> pm = PartitionMatrix(
... numpy.array(Partition(location = [(0, 1), (2, 4)],
... shape = [1, 2],
... _dimensions = ['dim2', 'dim0'],
... _directions = {'dim2': True, 'dim0': False},
... Units = cf.Units('m'),
... part = [],
... data = numpy.array([[5, 6], [7, 8]])),
... dtype=object),
... dimensions=[])
ndim | The number of partition dimensions in the partition matrix. |
shape | List of the partition matrix’s dimension sizes. |
size | The number of partitions in the partition matrix. |
Undocumented methods behave exactly as their counterparts in a built-in list.
add_partitions | Add partition boundaries. |
change_axis_names | dim_name_map should be a dictionary which maps each dimension names in |
copy | Return a deep copy. |
expand_dims | Insert a new size 1 partition dimension in place. |
ndenumerate | Return an iterator yielding pairs of array indices and values. |
partition_boundaries | Return the partition boundaries for each dimension. |
rollaxis | Roll the specified partition dimension backwards,in place until it lies in a given position. |
set_location_map | Recalculate the location attribute of each partition of the partition matrix in place. |
squeeze | Remove all size 1 partition dimensions in place. |
transpose | Permute the partition dimensions of the partition matrix in place. |