def IQR(df, columns, q1=0.25):
    """Detects outliers based on interquartile range (IQR).

    Parameters:
    ----------
    columns : str
        A string of columns which will be analysed together using IQR.

    q1 : float, default=0.25
        Threshold against which the outliers are detected.

    Returns
    ----------
    df_outliers_clean : dataframe
        Dataframe without outliers.

    df_outliers : dataframe
        Dataframe of outliers.

    """
    # remove outliers based on chosen columns
    print(columns)
    df_selected = df[columns]

    # remove outliers
    Q1 = df_selected.quantile(q1)
    Q3 = df_selected.quantile(1 - q1)
    IQR = Q3 - Q1

    df_clean = df[~((df_selected < (Q1 - 1.5 * IQR)) | (df_selected > (Q3 + 1.5 * IQR))).any(axis=1)]

    # get outliers df
    df_outliers = df[~df.index.isin(df_clean.index)]

    return df_clean, df_outliers