Remove size 1 axes from the data array.
By default all size 1 axes are removed from the field’s data array, but particular axes may be selected with the keyword arguments.
Squeezed axes are not squeezed from the domain’s coordinate and cell measure objects, nor are they removed from the field. To completely remove axes, use the field’s remove_axes method.
Parameters : |
|
---|---|
Returns : | out : cf.Field |
See also
axes, expand_dims, flip, remove_axes, swapaxes, transpose, unsqueeze
Examples
>>> f.squeeze()
>>> f.squeeze('time')
>>> f.squeeze(1)
>>> f.squeeze('dim2')
>>> f.squeeze([1, 'time', 'dim2'])
>>> f.squeeze({'units': 'Pa'})