def __init__(self, df: pd.DataFrame, mn: str, un: str, dim: str = 'col', digits: int = 5): """ Constructor / Initiate the class Parameters ---------- df : pandas.DataFrame DataFrame used for analysis mn : str string with all the results from the multivariate normality tests un : str string with all the results from the univariate normality tests dim : str indicate whether one wants to test for normality along the columns 'col' or rows 'row', default is 'col' digits : int number of decimal places to round down """ super().__init__(dim=dim, digits=digits) Assertor.evaluate_pd_dataframe(df) Assertor.evaluate_numeric_df(df) Assertor.evaluate_data_type({mn: str, un: str, dim: str, digits: int}) self.df = df self.mn = mn self.un = un self.dim = dim self.digits = digits
def __init__(self, df: pd.DataFrame): """ Constructor / Initiate the class Parameters ---------- df : pandas.DataFrame Dataframe for which one wants to test for normality """ Assertor.evaluate_pd_dataframe(df) Assertor.evaluate_numeric_df(df) if np.prod(df.shape) < 400: raise ValueError( "pd.DataFrame must have at least 400 observations, i.e. (20 x 20) in order to " "conduct any meaningful normality tests, got {}".format( df.shape)) self.df = df
def __init__(self, df: pd.DataFrame, dim: str = 'col', digits: int = 5): """ Constructor / Initiate the class Parameters ---------- df : pandas.DataFrame Dataframe for which one wants to generate / test dim : str indicate whether one wants to test for normality along the columns 'col' or rows 'row', default is 'col' digits : int number of decimal places to round down """ super().__init__(dim=dim, digits=digits) Assertor.evaluate_pd_dataframe(df) Assertor.evaluate_numeric_df(df) Assertor.evaluate_data_type({dim: str, digits: int}) self.df = df self.dim = dim self.digits = digits