def mean(self, axis: Optional[Axis]=None, numeric_only: bool=None) -> Union[(Scalar, 'Series')]:
    "\n        Return the mean of the values.\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\n        Returns\n        -------\n        mean : scalar for a Series, and a Series for a DataFrame.\n\n        Examples\n        --------\n\n        >>> df = ps.DataFrame({'a': [1, 2, 3, np.nan], 'b': [0.1, 0.2, 0.3, np.nan]},\n        ...                   columns=['a', 'b'])\n\n        On a DataFrame:\n\n        >>> df.mean()\n        a    2.0\n        b    0.2\n        dtype: float64\n\n        >>> df.mean(axis=1)\n        0    0.55\n        1    1.10\n        2    1.65\n        3     NaN\n        dtype: float64\n\n        On a Series:\n\n        >>> df['a'].mean()\n        2.0\n        "
    axis = validate_axis(axis)
    if ((numeric_only is None) and (axis == 0)):
        numeric_only = True

    def mean(spark_column: Column, spark_type: DataType) -> Column:
        if isinstance(spark_type, BooleanType):
            spark_column = spark_column.cast(LongType())
        elif (not isinstance(spark_type, NumericType)):
            raise TypeError('Could not convert {} ({}) to numeric'.format(spark_type_to_pandas_dtype(spark_type), spark_type.simpleString()))
        return F.mean(spark_column)
    return self._reduce_for_stat_function(mean, name='mean', axis=axis, numeric_only=numeric_only)
Return the mean of the values.

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.

Returns
-------
mean : scalar for a Series, and a Series for a DataFrame.

Examples
--------

>>> df = ps.DataFrame({'a': [1, 2, 3, np.nan], 'b': [0.1, 0.2, 0.3, np.nan]},
...                   columns=['a', 'b'])

On a DataFrame:

>>> df.mean()
a    2.0
b    0.2
dtype: float64

>>> df.mean(axis=1)
0    0.55
1    1.10
2    1.65
3     NaN
dtype: float64

On a Series:

>>> df['a'].mean()
2.0
def mean(self, axis: Optional[Axis]=None, numeric_only: bool=None) -> Union[(Scalar, 'Series')]:
    "\n        Return the mean of the values.\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\n        Returns\n        -------\n        mean : scalar for a Series, and a Series for a DataFrame.\n\n        Examples\n        --------\n\n        >>> df = ps.DataFrame({'a': [1, 2, 3, np.nan], 'b': [0.1, 0.2, 0.3, np.nan]},\n        ...                   columns=['a', 'b'])\n\n        On a DataFrame:\n\n        >>> df.mean()\n        a    2.0\n        b    0.2\n        dtype: float64\n\n        >>> df.mean(axis=1)\n        0    0.55\n        1    1.10\n        2    1.65\n        3     NaN\n        dtype: float64\n\n        On a Series:\n\n        >>> df['a'].mean()\n        2.0\n        "
    axis = validate_axis(axis)
    if ((numeric_only is None) and (axis == 0)):
        numeric_only = True

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