def clip_upper(self, threshold, axis=None, inplace=False):
    "\n        Trim values above a given threshold.\n\n        .. deprecated:: 0.24.0\n            Use clip(upper=threshold) instead.\n\n        Elements above the `threshold` will be changed to match the\n        `threshold` value(s). Threshold can be a single value or an array,\n        in the latter case it performs the truncation element-wise.\n\n        Parameters\n        ----------\n        threshold : numeric or array-like\n            Maximum value allowed. All values above threshold will be set to\n            this value.\n\n            * float : every value is compared to `threshold`.\n            * array-like : The shape of `threshold` should match the object\n              it's compared to. When `self` is a Series, `threshold` should be\n              the length. When `self` is a DataFrame, `threshold` should 2-D\n              and the same shape as `self` for ``axis=None``, or 1-D and the\n              same length as the axis being compared.\n\n        axis : {0 or 'index', 1 or 'columns'}, default 0\n            Align object with `threshold` 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\n        Returns\n        -------\n        Series or DataFrame\n            Original data with values trimmed.\n\n        See Also\n        --------\n        Series.clip : General purpose method to trim Series values to given\n            threshold(s).\n        DataFrame.clip : General purpose method to trim DataFrame values to\n            given threshold(s).\n\n        Examples\n        --------\n        >>> s = pd.Series([1, 2, 3, 4, 5])\n        >>> s\n        0    1\n        1    2\n        2    3\n        3    4\n        4    5\n        dtype: int64\n\n        >>> s.clip(upper=3)\n        0    1\n        1    2\n        2    3\n        3    3\n        4    3\n        dtype: int64\n\n        >>> elemwise_thresholds = [5, 4, 3, 2, 1]\n        >>> elemwise_thresholds\n        [5, 4, 3, 2, 1]\n\n        >>> s.clip(upper=elemwise_thresholds)\n        0    1\n        1    2\n        2    3\n        3    2\n        4    1\n        dtype: int64\n        "
    warnings.warn('clip_upper(threshold) is deprecated, use clip(upper=threshold) instead', FutureWarning, stacklevel=2)
    return self._clip_with_one_bound(threshold, method=self.le, axis=axis, inplace=inplace)
Trim values above a given threshold.

.. deprecated:: 0.24.0
    Use clip(upper=threshold) instead.

Elements above the `threshold` will be changed to match the
`threshold` value(s). Threshold can be a single value or an array,
in the latter case it performs the truncation element-wise.

Parameters
----------
threshold : numeric or array-like
    Maximum value allowed. All values above threshold will be set to
    this value.

    * float : every value is compared to `threshold`.
    * array-like : The shape of `threshold` should match the object
      it's compared to. When `self` is a Series, `threshold` should be
      the length. When `self` is a DataFrame, `threshold` should 2-D
      and the same shape as `self` for ``axis=None``, or 1-D and the
      same length as the axis being compared.

axis : {0 or 'index', 1 or 'columns'}, default 0
    Align object with `threshold` along the given axis.
inplace : bool, default False
    Whether to perform the operation in place on the data.

    .. versionadded:: 0.21.0

Returns
-------
Series or DataFrame
    Original data with values trimmed.

See Also
--------
Series.clip : General purpose method to trim Series values to given
    threshold(s).
DataFrame.clip : General purpose method to trim DataFrame values to
    given threshold(s).

Examples
--------
>>> s = pd.Series([1, 2, 3, 4, 5])
>>> s
0    1
1    2
2    3
3    4
4    5
dtype: int64

>>> s.clip(upper=3)
0    1
1    2
2    3
3    3
4    3
dtype: int64

>>> elemwise_thresholds = [5, 4, 3, 2, 1]
>>> elemwise_thresholds
[5, 4, 3, 2, 1]

>>> s.clip(upper=elemwise_thresholds)
0    1
1    2
2    3
3    2
4    1
dtype: int64
def clip_upper(self, threshold, axis=None, inplace=False):
    "\n        Trim values above a given threshold.\n\n        .. deprecated:: 0.24.0\n            Use clip(upper=threshold) instead.\n\n        Elements above the `threshold` will be changed to match the\n        `threshold` value(s). Threshold can be a single value or an array,\n        in the latter case it performs the truncation element-wise.\n\n        Parameters\n        ----------\n        threshold : numeric or array-like\n            Maximum value allowed. All values above threshold will be set to\n            this value.\n\n            * float : every value is compared to `threshold`.\n            * array-like : The shape of `threshold` should match the object\n              it's compared to. When `self` is a Series, `threshold` should be\n              the length. When `self` is a DataFrame, `threshold` should 2-D\n              and the same shape as `self` for ``axis=None``, or 1-D and the\n              same length as the axis being compared.\n\n        axis : {0 or 'index', 1 or 'columns'}, default 0\n            Align object with `threshold` 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\n        Returns\n        -------\n        Series or DataFrame\n            Original data with values trimmed.\n\n        See Also\n        --------\n        Series.clip : General purpose method to trim Series values to given\n            threshold(s).\n        DataFrame.clip : General purpose method to trim DataFrame values to\n            given threshold(s).\n\n        Examples\n        --------\n        >>> s = pd.Series([1, 2, 3, 4, 5])\n        >>> s\n        0    1\n        1    2\n        2    3\n        3    4\n        4    5\n        dtype: int64\n\n        >>> s.clip(upper=3)\n        0    1\n        1    2\n        2    3\n        3    3\n        4    3\n        dtype: int64\n\n        >>> elemwise_thresholds = [5, 4, 3, 2, 1]\n        >>> elemwise_thresholds\n        [5, 4, 3, 2, 1]\n\n        >>> s.clip(upper=elemwise_thresholds)\n        0    1\n        1    2\n        2    3\n        3    2\n        4    1\n        dtype: int64\n        "
    warnings.warn('clip_upper(threshold) is deprecated, use clip(upper=threshold) instead', FutureWarning, stacklevel=2)
    return self._clip_with_one_bound(threshold, method=self.le, axis=axis, inplace=inplace)