Remove size 1 axes from the data array.
By default all size 1 axes are removed, but particular size 1 axes may
be selected for removal.
The axes are selected with the axes parameter.
Squeezed axes are not removed from the coordinate and cell measure
objects, nor are they removed from the domain. To completely remove
axes, use the remove_axes method.
Remove all size axes from the data array:
Remove the size 1 time axis:
Parameters: |
- axes, kwargs : optional
Select axes. The axes parameter may be one, or a sequence,
of:
- None. If no kwargs arguments have been set
then all axes are selected. This is the default.
Any value accepted by the items parameter of the field’s
items method. Used in conjunction with the kwargs
parameters to select the axes which span the items that
would be identified by this call of the field’s items
method: f.items(items=axes, axes=None, **kwargs). See
cf.Field.items for details.
- Example:
To select the axes spanned by one dimensionsal time
coordinates: f.squeeze('T', ndim=1).
If axes is a sequence of any combination of the above then
the selected axes are the union of those selected by each
element of the sequence. If the sequence is empty then no axes
are selected.
- i : bool, optional
If True then update the field in place. By default a new
field is created. In either case, a field is
returned.
|
Returns: |
- out : cf.Field
The squeezed field.
|
Examples 2: | |