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

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