cf.Variable.squeeze

Variable.squeeze(axes=None, i=False)[source]

Remove size 1 dimensions from the data array in place.

Parameters :
axes : (sequence of) int, optional

The size 1 axes to remove. By default, all size 1 axes are removed. Size 1 axes for removal are identified by their integer positions in the data array.

i : bool, optional

Returns :

out : cf.Variable

Examples

>>> v.squeeze()
>>> v.squeeze(1)
>>> v.squeeze([1, 2])

Previous topic

cf.Variable.sin

Next topic

cf.Variable.transpose

This Page