def clip(self, lower=None, upper=None, axis=None, inplace=False, *args, **kwargs):
    "\n        Trim values at input threshold(s).\n\n        Assigns values outside boundary to boundary values. Thresholds\n        can be singular values or array like, and in the latter case\n        the clipping is performed element-wise in the specified axis.\n\n        Parameters\n        ----------\n        lower : float or array_like, default None\n            Minimum threshold value. All values below this\n            threshold will be set to it.\n        upper : float or array_like, default None\n            Maximum threshold value. All values above this\n            threshold will be set to it.\n        axis : int or str axis name, optional\n            Align object with lower and upper along the given axis.\n        inplace : bool, default False\n            Whether to perform the operation in place on the data.\n\n            .. versionadded:: 0.21.0\n        *args, **kwargs\n            Additional keywords have no effect but might be accepted\n            for compatibility with numpy.\n\n        Returns\n        -------\n        Series or DataFrame\n            Same type as calling object with the values outside the\n            clip boundaries replaced.\n\n        Examples\n        --------\n        >>> data = {'col_0': [9, -3, 0, -1, 5], 'col_1': [-2, -7, 6, 8, -5]}\n        >>> df = pd.DataFrame(data)\n        >>> df\n           col_0  col_1\n        0      9     -2\n        1     -3     -7\n        2      0      6\n        3     -1      8\n        4      5     -5\n\n        Clips per column using lower and upper thresholds:\n\n        >>> df.clip(-4, 6)\n           col_0  col_1\n        0      6     -2\n        1     -3     -4\n        2      0      6\n        3     -1      6\n        4      5     -4\n\n        Clips using specific lower and upper thresholds per column element:\n\n        >>> t = pd.Series([2, -4, -1, 6, 3])\n        >>> t\n        0    2\n        1   -4\n        2   -1\n        3    6\n        4    3\n        dtype: int64\n\n        >>> df.clip(t, t + 4, axis=0)\n           col_0  col_1\n        0      6      2\n        1     -3     -4\n        2      0      3\n        3      6      8\n        4      5      3\n        "
    if isinstance(self, ABCPanel):
        raise NotImplementedError('clip is not supported yet for panels')
    inplace = validate_bool_kwarg(inplace, 'inplace')
    axis = nv.validate_clip_with_axis(axis, args, kwargs)
    if (axis is not None):
        axis = self._get_axis_number(axis)
    if ((not is_list_like(lower)) and np.any(pd.isnull(lower))):
        lower = None
    if ((not is_list_like(upper)) and np.any(pd.isnull(upper))):
        upper = None
    if ((lower is not None) and (upper is not None)):
        if (is_scalar(lower) and is_scalar(upper)):
            (lower, upper) = (min(lower, upper), max(lower, upper))
    if (((lower is None) or (is_scalar(lower) and is_number(lower))) and ((upper is None) or (is_scalar(upper) and is_number(upper)))):
        return self._clip_with_scalar(lower, upper, inplace=inplace)
    result = self
    if (lower is not None):
        result = result._clip_with_one_bound(lower, method=self.ge, axis=axis, inplace=inplace)
    if (upper is not None):
        if inplace:
            result = self
        result = result._clip_with_one_bound(upper, method=self.le, axis=axis, inplace=inplace)
    return result
Trim values at input threshold(s).

Assigns values outside boundary to boundary values. Thresholds
can be singular values or array like, and in the latter case
the clipping is performed element-wise in the specified axis.

Parameters
----------
lower : float or array_like, default None
    Minimum threshold value. All values below this
    threshold will be set to it.
upper : float or array_like, default None
    Maximum threshold value. All values above this
    threshold will be set to it.
axis : int or str axis name, optional
    Align object with lower and upper along the given axis.
inplace : bool, default False
    Whether to perform the operation in place on the data.

    .. versionadded:: 0.21.0
*args, **kwargs
    Additional keywords have no effect but might be accepted
    for compatibility with numpy.

Returns
-------
Series or DataFrame
    Same type as calling object with the values outside the
    clip boundaries replaced.

Examples
--------
>>> data = {'col_0': [9, -3, 0, -1, 5], 'col_1': [-2, -7, 6, 8, -5]}
>>> df = pd.DataFrame(data)
>>> df
   col_0  col_1
0      9     -2
1     -3     -7
2      0      6
3     -1      8
4      5     -5

Clips per column using lower and upper thresholds:

>>> df.clip(-4, 6)
   col_0  col_1
0      6     -2
1     -3     -4
2      0      6
3     -1      6
4      5     -4

Clips using specific lower and upper thresholds per column element:

>>> t = pd.Series([2, -4, -1, 6, 3])
>>> t
0    2
1   -4
2   -1
3    6
4    3
dtype: int64

>>> df.clip(t, t + 4, axis=0)
   col_0  col_1
0      6      2
1     -3     -4
2      0      3
3      6      8
4      5      3
def clip(self, lower=None, upper=None, axis=None, inplace=False, *args, **kwargs):
    "\n        Trim values at input threshold(s).\n\n        Assigns values outside boundary to boundary values. Thresholds\n        can be singular values or array like, and in the latter case\n        the clipping is performed element-wise in the specified axis.\n\n        Parameters\n        ----------\n        lower : float or array_like, default None\n            Minimum threshold value. All values below this\n            threshold will be set to it.\n        upper : float or array_like, default None\n            Maximum threshold value. All values above this\n            threshold will be set to it.\n        axis : int or str axis name, optional\n            Align object with lower and upper along the given axis.\n        inplace : bool, default False\n            Whether to perform the operation in place on the data.\n\n            .. versionadded:: 0.21.0\n        *args, **kwargs\n            Additional keywords have no effect but might be accepted\n            for compatibility with numpy.\n\n        Returns\n        -------\n        Series or DataFrame\n            Same type as calling object with the values outside the\n            clip boundaries replaced.\n\n        Examples\n        --------\n        >>> data = {'col_0': [9, -3, 0, -1, 5], 'col_1': [-2, -7, 6, 8, -5]}\n        >>> df = pd.DataFrame(data)\n        >>> df\n           col_0  col_1\n        0      9     -2\n        1     -3     -7\n        2      0      6\n        3     -1      8\n        4      5     -5\n\n        Clips per column using lower and upper thresholds:\n\n        >>> df.clip(-4, 6)\n           col_0  col_1\n        0      6     -2\n        1     -3     -4\n        2      0      6\n        3     -1      6\n        4      5     -4\n\n        Clips using specific lower and upper thresholds per column element:\n\n        >>> t = pd.Series([2, -4, -1, 6, 3])\n        >>> t\n        0    2\n        1   -4\n        2   -1\n        3    6\n        4    3\n        dtype: int64\n\n        >>> df.clip(t, t + 4, axis=0)\n           col_0  col_1\n        0      6      2\n        1     -3     -4\n        2      0      3\n        3      6      8\n        4      5      3\n        "
    if isinstance(self, ABCPanel):
        raise NotImplementedError('clip is not supported yet for panels')
    inplace = validate_bool_kwarg(inplace, 'inplace')
    axis = nv.validate_clip_with_axis(axis, args, kwargs)
    if (axis is not None):
        axis = self._get_axis_number(axis)
    if ((not is_list_like(lower)) and np.any(pd.isnull(lower))):
        lower = None
    if ((not is_list_like(upper)) and np.any(pd.isnull(upper))):
        upper = None
    if ((lower is not None) and (upper is not None)):
        if (is_scalar(lower) and is_scalar(upper)):
            (lower, upper) = (min(lower, upper), max(lower, upper))
    if (((lower is None) or (is_scalar(lower) and is_number(lower))) and ((upper is None) or (is_scalar(upper) and is_number(upper)))):
        return self._clip_with_scalar(lower, upper, inplace=inplace)
    result = self
    if (lower is not None):
        result = result._clip_with_one_bound(lower, method=self.ge, axis=axis, inplace=inplace)
    if (upper is not None):
        if inplace:
            result = self
        result = result._clip_with_one_bound(upper, method=self.le, axis=axis, inplace=inplace)
    return result