Field.unsqueeze(inplace=False, i=False, axes=None, **kwargs)[source]

Insert size 1 axes into the data array.

All size 1 domain axes which are not spanned by the field construct’s data are inserted.

The axes are inserted into the slowest varying data array positions.

inplace: bool, optional

If True then do the operation in-place and return None.

i: deprecated at version 3.0.0

Use the inplace parameter instead.

axes: deprecated at version 3.0.0

kwargs: deprecated at version 3.0.0

Field or None

The field construct with size-1 axes inserted in its data, or None if the operation was in-place.


>>> g = f.unsqueeze()
>>> f.unsqueeze(['dim2'], inplace=True)