def abs(self):
    "\n        Return a Series/DataFrame with absolute numeric value of each element.\n\n        This function only applies to elements that are all numeric.\n\n        Returns\n        -------\n        abs\n            Series/DataFrame containing the absolute value of each element.\n\n        See Also\n        --------\n        numpy.absolute : Calculate the absolute value element-wise.\n\n        Notes\n        -----\n        For ``complex`` inputs, ``1.2 + 1j``, the absolute value is\n        :math:`\\sqrt{ a^2 + b^2 }`.\n\n        Examples\n        --------\n        Absolute numeric values in a Series.\n\n        >>> s = pd.Series([-1.10, 2, -3.33, 4])\n        >>> s.abs()\n        0    1.10\n        1    2.00\n        2    3.33\n        3    4.00\n        dtype: float64\n\n        Absolute numeric values in a Series with complex numbers.\n\n        >>> s = pd.Series([1.2 + 1j])\n        >>> s.abs()\n        0    1.56205\n        dtype: float64\n\n        Absolute numeric values in a Series with a Timedelta element.\n\n        >>> s = pd.Series([pd.Timedelta('1 days')])\n        >>> s.abs()\n        0   1 days\n        dtype: timedelta64[ns]\n\n        Select rows with data closest to certain value using argsort (from\n        `StackOverflow <https://stackoverflow.com/a/17758115>`__).\n\n        >>> df = pd.DataFrame({\n        ...     'a': [4, 5, 6, 7],\n        ...     'b': [10, 20, 30, 40],\n        ...     'c': [100, 50, -30, -50]\n        ... })\n        >>> df\n             a    b    c\n        0    4   10  100\n        1    5   20   50\n        2    6   30  -30\n        3    7   40  -50\n        >>> df.loc[(df.c - 43).abs().argsort()]\n             a    b    c\n        1    5   20   50\n        0    4   10  100\n        2    6   30  -30\n        3    7   40  -50\n        "
    return np.abs(self)
Return a Series/DataFrame with absolute numeric value of each element.

This function only applies to elements that are all numeric.

Returns
-------
abs
    Series/DataFrame containing the absolute value of each element.

See Also
--------
numpy.absolute : Calculate the absolute value element-wise.

Notes
-----
For ``complex`` inputs, ``1.2 + 1j``, the absolute value is
:math:`\sqrt{ a^2 + b^2 }`.

Examples
--------
Absolute numeric values in a Series.

>>> s = pd.Series([-1.10, 2, -3.33, 4])
>>> s.abs()
0    1.10
1    2.00
2    3.33
3    4.00
dtype: float64

Absolute numeric values in a Series with complex numbers.

>>> s = pd.Series([1.2 + 1j])
>>> s.abs()
0    1.56205
dtype: float64

Absolute numeric values in a Series with a Timedelta element.

>>> s = pd.Series([pd.Timedelta('1 days')])
>>> s.abs()
0   1 days
dtype: timedelta64[ns]

Select rows with data closest to certain value using argsort (from
`StackOverflow <https://stackoverflow.com/a/17758115>`__).

>>> df = pd.DataFrame({
...     'a': [4, 5, 6, 7],
...     'b': [10, 20, 30, 40],
...     'c': [100, 50, -30, -50]
... })
>>> df
     a    b    c
0    4   10  100
1    5   20   50
2    6   30  -30
3    7   40  -50
>>> df.loc[(df.c - 43).abs().argsort()]
     a    b    c
1    5   20   50
0    4   10  100
2    6   30  -30
3    7   40  -50
def abs(self):
    "\n        Return a Series/DataFrame with absolute numeric value of each element.\n\n        This function only applies to elements that are all numeric.\n\n        Returns\n        -------\n        abs\n            Series/DataFrame containing the absolute value of each element.\n\n        See Also\n        --------\n        numpy.absolute : Calculate the absolute value element-wise.\n\n        Notes\n        -----\n        For ``complex`` inputs, ``1.2 + 1j``, the absolute value is\n        :math:`\\sqrt{ a^2 + b^2 }`.\n\n        Examples\n        --------\n        Absolute numeric values in a Series.\n\n        >>> s = pd.Series([-1.10, 2, -3.33, 4])\n        >>> s.abs()\n        0    1.10\n        1    2.00\n        2    3.33\n        3    4.00\n        dtype: float64\n\n        Absolute numeric values in a Series with complex numbers.\n\n        >>> s = pd.Series([1.2 + 1j])\n        >>> s.abs()\n        0    1.56205\n        dtype: float64\n\n        Absolute numeric values in a Series with a Timedelta element.\n\n        >>> s = pd.Series([pd.Timedelta('1 days')])\n        >>> s.abs()\n        0   1 days\n        dtype: timedelta64[ns]\n\n        Select rows with data closest to certain value using argsort (from\n        `StackOverflow <https://stackoverflow.com/a/17758115>`__).\n\n        >>> df = pd.DataFrame({\n        ...     'a': [4, 5, 6, 7],\n        ...     'b': [10, 20, 30, 40],\n        ...     'c': [100, 50, -30, -50]\n        ... })\n        >>> df\n             a    b    c\n        0    4   10  100\n        1    5   20   50\n        2    6   30  -30\n        3    7   40  -50\n        >>> df.loc[(df.c - 43).abs().argsort()]\n             a    b    c\n        1    5   20   50\n        0    4   10  100\n        2    6   30  -30\n        3    7   40  -50\n        "
    return np.abs(self)