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)
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)