(df, method="zeros")
Fill empty values in a Data Frame with the chosen method.
    Valid options for method are: zeros, mean, median, mode
Fill empty values in a Data Frame with the chosen method.
    Valid options for method are: zeros, mean, median, mode
Fill empty values in a Data Frame with the chosen method . Valid options for method are : zeros mean median mode
def fillna(df, method="zeros"):
    """
    Fill empty values in a Data Frame with the chosen method.
    Valid options for method are: zeros, mean, median, mode
    """

    if method == "mean":
        return df.fillna(df.mean())
    elif method == "median":
        return df.fillna(df.median())
    elif method == "mode":
        return df.fillna(df.mode().iloc[0])
    elif method == "none":
        return df
    else:
        return df.fillna(0)
def fillna ( df , method = "zeros" ) : if method == "mean" : return df . fillna ( df . mean ( ) ) elif method == "median" : return df . fillna ( df . median ( ) ) elif method == "mode" : return df . fillna ( df . mode ( ) . iloc [ 0 ] ) elif method == "none" : return df else : return df . fillna ( 0 )