deepaugment/lib/pandas_utilities.py
def df_correlations(df, features):
    """ Calculates pearson and spearman correlations of each tuple of given features
        
    Args:
        df (pandas.DataFrame)
        features (list): features to calculate their correlations
    """
    rowList = []
    for i, feature_val in enumerate(features):
        for j in range(i + 1, len(features)):
            feat1 = feature_val
            feat2 = feature_val
            tmp_df = df[(df[feat1].notnull()) & (df[feat2].notnull())]
            p_r, p_p = pearsonr(tmp_df[feat1], tmp_df[feat2])
            s_r, s_p = spearmanr(tmp_df[feat1], tmp_df[feat2])
            rowList.append([feat1, feat2, p_r, p_p, s_r, s_p])

    return pd.DataFrame(
        rowList,
        columns=[
            "column1",
            "column2",
            "pearson_r",
            "pearson_pvalue",
            "spearman_r",
            "spearman_pvalue",
        ],
    )
 Calculates pearson and spearman correlations of each tuple of given features
        
    Args:
        df (pandas.DataFrame)
        features (list): features to calculate their correlations
    
Calculates pearson and spearman correlations of each tuple of given features
Args:
df (pandas.DataFrame)
features (list): features to calculate their correlations
Calculates pearson and spearman correlations of each tuple of given features Args : df ( pandas . DataFrame ) features ( list ) : features to calculate their correlations
def df_correlations(df, features):
    rowList = []
    for i, feature_val in enumerate(features):
        for j in range(i + 1, len(features)):
            feat1 = feature_val
            feat2 = feature_val
            tmp_df = df[(df[feat1].notnull()) & (df[feat2].notnull())]
            p_r, p_p = pearsonr(tmp_df[feat1], tmp_df[feat2])
            s_r, s_p = spearmanr(tmp_df[feat1], tmp_df[feat2])
            rowList.append([feat1, feat2, p_r, p_p, s_r, s_p])
    return pd.DataFrame(
        rowList,
        columns=[
            "column1",
            "column2",
            "pearson_r",
            "pearson_pvalue",
            "spearman_r",
            "spearman_pvalue",
        ],
    )
def df_correlations ( df , features ) : rowList = [ ] for i , feature_val in enumerate ( features ) : for j in range ( i + 1 , len ( features ) ) : feat1 = feature_val feat2 = feature_val tmp_df = df [ ( df [ feat1 ] . notnull ( ) ) & ( df [ feat2 ] . notnull ( ) ) ] p_r , p_p = pearsonr ( tmp_df [ feat1 ] , tmp_df [ feat2 ] ) s_r , s_p = spearmanr ( tmp_df [ feat1 ] , tmp_df [ feat2 ] ) rowList . append ( [ feat1 , feat2 , p_r , p_p , s_r , s_p ] ) return pd . DataFrame ( rowList , columns = [ "column1" , "column2" , "pearson_r" , "pearson_pvalue" , "spearman_r" , "spearman_pvalue" , ] , )
Calculates pearson and spearman correlations of each tuple of given features
Args:
df (pandas.DataFrame)
features (list): features to calculate their correlations
Calculates pearson and spearman correlations of each tuple of given features Args : df ( pandas . DataFrame ) features ( list ) : features to calculate their correlations
""" Calculates pearson and spearman correlations of each tuple of given features
        
    Args:
        df (pandas.DataFrame)
        features (list): features to calculate their correlations
    """
df
features