cf.Field.squeeze

Field.squeeze(axes=None, from_space=False)

Remove size 1 dimensions from the field’s data array in place.

Parameters :
axes : optional

The size 1 axes to remove. By default, all size 1 axes are removed. Size 1 axes for removal may be identified with one of, or a sequence of any combination of:

  • A dimension’s standard name.
  • The integer position of a dimension in the data array.
  • The field’s space’s internal name of a dimension
Returns :

None

Examples

>>> f.squeeze()
>>> f.squeeze('time')
>>> f.squeeze(1)
>>> f.squeeze('dim2')
>>> f.squeeze([1, 'time', 'dim2'])
>>> f.squeeze('height', from_space=True)

Previous topic

cf.Field.sin

Next topic

cf.Field.subset

This Page