cf.Field.squeeze

Field.squeeze(axes=None)

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'])

Previous topic

cf.Field.setattr

Next topic

cf.Field.transpose

This Page