def squeeze(self, axis=None):
    """ Squeeze singleton axes
    
    Analogous to numpy, but also allows axis name

    Parameters
    ----------
    axis : int or str or None 
        axis to squeeze
        default is None, to remove all singleton axes

    Returns
    -------
    squeezed_array : DimArray

    Examples
    --------
    >>> import dimarray as da
    >>> a = da.DimArray([[[1,2,3]]])
    >>> a
    dimarray: 3 non-null elements (0 null)
    0 / x0 (1): 0 to 0
    1 / x1 (1): 0 to 0
    2 / x2 (3): 0 to 2
    array([[[1, 2, 3]]])
    >>> a.squeeze()
    dimarray: 3 non-null elements (0 null)
    0 / x2 (3): 0 to 2
    array([1, 2, 3])
    >>> a.squeeze(axis='x1')
    dimarray: 3 non-null elements (0 null)
    0 / x0 (1): 0 to 0
    1 / x2 (3): 0 to 2
    array([[1, 2, 3]])
    """
    if axis is None:
        newaxes = [ax for ax in self.axes if ax.size != 1]
        res = self.values.squeeze()

    else:
        idx, name = self._get_axis_info(axis) 
        res = self.values.squeeze(idx)
        newaxes = [ax for ax in self.axes if ax.name != name or ax.size != 1] 

    return self._constructor(res, newaxes, **self.attrs)