def median(self, axis: Optional[Axis]=None, numeric_only: bool=None, accuracy: int=10000) -> Union[(Scalar, 'Series')]:
    "\n        Return the median of the values for the requested axis.\n\n        .. note:: Unlike pandas', the median in pandas-on-Spark is an approximated median based upon\n            approximate percentile computation because computing median across a large dataset\n            is extremely expensive.\n\n        Parameters\n        ----------\n        axis : {index (0), columns (1)}\n            Axis for the function to be applied on.\n        numeric_only : bool, default None\n            Include only float, int, boolean columns. False is not supported. This parameter\n            is mainly for pandas compatibility.\n        accuracy : int, optional\n            Default accuracy of approximation. Larger value means better accuracy.\n            The relative error can be deduced by 1.0 / accuracy.\n\n        Returns\n        -------\n        median : scalar or Series\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({\n        ...     'a': [24., 21., 25., 33., 26.], 'b': [1, 2, 3, 4, 5]}, columns=['a', 'b'])\n        >>> df\n              a  b\n        0  24.0  1\n        1  21.0  2\n        2  25.0  3\n        3  33.0  4\n        4  26.0  5\n\n        On a DataFrame:\n\n        >>> df.median()\n        a    25.0\n        b     3.0\n        dtype: float64\n\n        On a Series:\n\n        >>> df['a'].median()\n        25.0\n        >>> (df['b'] + 100).median()\n        103.0\n\n        For multi-index columns,\n\n        >>> df.columns = pd.MultiIndex.from_tuples([('x', 'a'), ('y', 'b')])\n        >>> df\n              x  y\n              a  b\n        0  24.0  1\n        1  21.0  2\n        2  25.0  3\n        3  33.0  4\n        4  26.0  5\n\n        On a DataFrame:\n\n        >>> df.median()\n        x  a    25.0\n        y  b     3.0\n        dtype: float64\n\n        >>> df.median(axis=1)\n        0    12.5\n        1    11.5\n        2    14.0\n        3    18.5\n        4    15.5\n        dtype: float64\n\n        On a Series:\n\n        >>> df[('x', 'a')].median()\n        25.0\n        >>> (df[('y', 'b')] + 100).median()\n        103.0\n        "
    axis = validate_axis(axis)
    if ((numeric_only is None) and (axis == 0)):
        numeric_only = True
    if (not isinstance(accuracy, int)):
        raise TypeError(('accuracy must be an integer; however, got [%s]' % type(accuracy).__name__))

    def median(spark_column: Column, spark_type: DataType) -> Column:
        if isinstance(spark_type, (BooleanType, NumericType)):
            return F.percentile_approx(spark_column.cast(DoubleType()), 0.5, accuracy)
        else:
            raise TypeError('Could not convert {} ({}) to numeric'.format(spark_type_to_pandas_dtype(spark_type), spark_type.simpleString()))
    return self._reduce_for_stat_function(median, name='median', numeric_only=numeric_only, axis=axis)
Return the median of the values for the requested axis.

.. note:: Unlike pandas', the median in pandas-on-Spark is an approximated median based upon
    approximate percentile computation because computing median across a large dataset
    is extremely expensive.

Parameters
----------
axis : {index (0), columns (1)}
    Axis for the function to be applied on.
numeric_only : bool, default None
    Include only float, int, boolean columns. False is not supported. This parameter
    is mainly for pandas compatibility.
accuracy : int, optional
    Default accuracy of approximation. Larger value means better accuracy.
    The relative error can be deduced by 1.0 / accuracy.

Returns
-------
median : scalar or Series

Examples
--------
>>> df = ps.DataFrame({
...     'a': [24., 21., 25., 33., 26.], 'b': [1, 2, 3, 4, 5]}, columns=['a', 'b'])
>>> df
      a  b
0  24.0  1
1  21.0  2
2  25.0  3
3  33.0  4
4  26.0  5

On a DataFrame:

>>> df.median()
a    25.0
b     3.0
dtype: float64

On a Series:

>>> df['a'].median()
25.0
>>> (df['b'] + 100).median()
103.0

For multi-index columns,

>>> df.columns = pd.MultiIndex.from_tuples([('x', 'a'), ('y', 'b')])
>>> df
      x  y
      a  b
0  24.0  1
1  21.0  2
2  25.0  3
3  33.0  4
4  26.0  5

On a DataFrame:

>>> df.median()
x  a    25.0
y  b     3.0
dtype: float64

>>> df.median(axis=1)
0    12.5
1    11.5
2    14.0
3    18.5
4    15.5
dtype: float64

On a Series:

>>> df[('x', 'a')].median()
25.0
>>> (df[('y', 'b')] + 100).median()
103.0
def median(self, axis: Optional[Axis]=None, numeric_only: bool=None, accuracy: int=10000) -> Union[(Scalar, 'Series')]:
    "\n        Return the median of the values for the requested axis.\n\n        .. note:: Unlike pandas', the median in pandas-on-Spark is an approximated median based upon\n            approximate percentile computation because computing median across a large dataset\n            is extremely expensive.\n\n        Parameters\n        ----------\n        axis : {index (0), columns (1)}\n            Axis for the function to be applied on.\n        numeric_only : bool, default None\n            Include only float, int, boolean columns. False is not supported. This parameter\n            is mainly for pandas compatibility.\n        accuracy : int, optional\n            Default accuracy of approximation. Larger value means better accuracy.\n            The relative error can be deduced by 1.0 / accuracy.\n\n        Returns\n        -------\n        median : scalar or Series\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({\n        ...     'a': [24., 21., 25., 33., 26.], 'b': [1, 2, 3, 4, 5]}, columns=['a', 'b'])\n        >>> df\n              a  b\n        0  24.0  1\n        1  21.0  2\n        2  25.0  3\n        3  33.0  4\n        4  26.0  5\n\n        On a DataFrame:\n\n        >>> df.median()\n        a    25.0\n        b     3.0\n        dtype: float64\n\n        On a Series:\n\n        >>> df['a'].median()\n        25.0\n        >>> (df['b'] + 100).median()\n        103.0\n\n        For multi-index columns,\n\n        >>> df.columns = pd.MultiIndex.from_tuples([('x', 'a'), ('y', 'b')])\n        >>> df\n              x  y\n              a  b\n        0  24.0  1\n        1  21.0  2\n        2  25.0  3\n        3  33.0  4\n        4  26.0  5\n\n        On a DataFrame:\n\n        >>> df.median()\n        x  a    25.0\n        y  b     3.0\n        dtype: float64\n\n        >>> df.median(axis=1)\n        0    12.5\n        1    11.5\n        2    14.0\n        3    18.5\n        4    15.5\n        dtype: float64\n\n        On a Series:\n\n        >>> df[('x', 'a')].median()\n        25.0\n        >>> (df[('y', 'b')] + 100).median()\n        103.0\n        "
    axis = validate_axis(axis)
    if ((numeric_only is None) and (axis == 0)):
        numeric_only = True
    if (not isinstance(accuracy, int)):
        raise TypeError(('accuracy must be an integer; however, got [%s]' % type(accuracy).__name__))

    def median(spark_column: Column, spark_type: DataType) -> Column:
        if isinstance(spark_type, (BooleanType, NumericType)):
            return F.percentile_approx(spark_column.cast(DoubleType()), 0.5, accuracy)
        else:
            raise TypeError('Could not convert {} ({}) to numeric'.format(spark_type_to_pandas_dtype(spark_type), spark_type.simpleString()))
    return self._reduce_for_stat_function(median, name='median', numeric_only=numeric_only, axis=axis)