cf.Field.expand_dims

Field.expand_dims(position=0, axis=None, i=False, **kwargs)[source]

Insert a size 1 axis into the data array.

Parameters :
position : int, optional

Specify the position that the new axis will have in the data array axes. By default the new axis has position 0, the slowest varying position.

axis, kwargs : optional

Specify the axis to insert. By default a new size 1 axis is inserted which doesn’t yet exist.

If axis and/or kwargs are set then the axis is the unique, size 1 axis that would be selected by this call of the field’s axes method: f.axes(axis, size=1, **kwargs). See cf.Field.axes for details.

i : bool, optional

If True then update the field in place. By default a new field is created.

Returns :

out : cf.Field

See also

axes, flip, squeeze, swapaxes, transpose, unsqueeze,

Examples

Previous topic

cf.Field.equivalent_domain

Next topic

cf.Field.fill_value

This Page