cf.Domain.expand_dims

Domain.expand_dims(coord=None, size=1, copy=True)[source]

Expand the domain with a new dimension in place.

The new dimension may by of any size greater then 0.

Parameters:
coord
: cf.Coordinate, optional

A dimension coordinate for the new dimension. The new dimension’s size is set to the size of the coordinate’s array.

size
: int, optional

The size of the new dimension. By default a dimension of size 1 is introduced. Ignored if coord is set.

Returns:

None

Examples:
>>> d.expand_dims()
>>> d.expand_dims(size=12)
>>> c
<CF DimensionCoordinate: >
>>> d.expand_dims(coord=c)