def squeeze(self, axis=None):
if not any([d == <NUM_LIT:1> for d in self.shape]):<EOL><INDENT>return self<EOL><DEDENT>if axis is None:<EOL><INDENT>drop = where(asarray(self.shape) == <NUM_LIT:1>)[<NUM_LIT:0>]<EOL><DEDENT>elif isinstance(axis, int):<EOL><INDENT>drop = asarray((axis,))<EOL><DEDENT>elif isinstance(axis, tuple):<EOL><INDENT>drop = asarray(axis)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if any([self.shape[i] > <NUM_LIT:1> for i in drop]):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if any(asarray(drop) < self.split):<EOL><INDENT>kmask = set([d for d in drop if d < self.split])<EOL>kfunc = lambda k: tuple([kk for ii, kk in enumerate(k) if ii not in kmask])<EOL><DEDENT>else:<EOL><INDENT>kfunc = lambda k: k<EOL><DEDENT>if any(asarray(drop) >= self.split):<EOL><INDENT>vmask = tuple([d - self.split for d in drop if d >= self.split])<EOL>vfunc = lambda v: v.squeeze(vmask)<EOL><DEDENT>else:<EOL><INDENT>vfunc = lambda v: v<EOL><DEDENT>rdd = self._rdd.map(lambda kv: (kfunc(kv[<NUM_LIT:0>]), vfunc(kv[<NUM_LIT:1>])))<EOL>shape = tuple([ss for ii, ss in enumerate(self.shape) if ii not in drop])<EOL>split = len([d for d in range(self.keys.ndim) if d not in drop])<EOL>return self._constructor(rdd, shape=shape, split=split).__finalize__(self)<EOL>
Remove one or more single-dimensional axes from the array.

Parameters
----------
axis : tuple or int
    One or more singleton axes to remove.