def column_structural_typicality(X_L_list, col_id):
    """Returns how typical column is (opposite of how anomalous)."""
    count = 0
    for X_L in X_L_list:
        for c in range(len(X_L['column_partition']['assignments'])):
            if X_L['column_partition']['assignments'][col_id] ==\
                    X_L['column_partition']['assignments'][c]:
                count += 1
    return float(count) / \
        (len(X_L_list) * len(X_L_list[0]['column_partition']['assignments']))
def column_structural_typicality ( X_L_list , col_id ) : count = 0 for X_L in X_L_list : for c in range ( len ( X_L [ 'column_partition' ] [ 'assignments' ] ) ) : if X_L [ 'column_partition' ] [ 'assignments' ] [ col_id ] == X_L [ 'column_partition' ] [ 'assignments' ] [ c ] : count += 1 return float ( count ) / ( len ( X_L_list ) * len ( X_L_list [ 0 ] [ 'column_partition' ] [ 'assignments' ] ) )
Returns how typical column is (opposite of how anomalous).