cf.PartitionMatrix.expand_dims

PartitionMatrix.expand_dims(axis)[source]

Insert a new size 1 axis in place.

The new axis is always inserted at position 0, i.e. it becomes the new slowest varying axis.

Parameters :
axis : str

The identity of the new axis.

Returns :

None

Examples

>>> pm.shape
(2, 3)
>>> pm.expand_dims('dim2')
>>> pm.shape
(1, 2, 3)

Previous topic

cf.PartitionMatrix.copy

Next topic

cf.PartitionMatrix.ndenumerate

This Page