Funktion zum Erkennen von Ausreißer in Python

def detect_outliers(df, columns):
    outlier_indices = []
    
    for c in columns:
        # 1st quartile
        q1 = np.percentile(df[c], 25)
        
        # 3rd quqartile
        q3 = np.percentile(df[c], 75)
        
…        outlier_indices.extend(outlier_list_col)
        
    outlier_indices = Counter(outlier_indices)
    multiple_outlier = list(i for i,v in outlier_indices.items() if v > 2)
    
    return multiple_outlier
Thankful Toad