def get_dataset_concentration(df, N=0.33):
    """Interactions associated to the top-N most popular item

    Args:
        df: user-item interaction df
        N (float): percentage of top popular items to consider when computing concentration
    Returns:
        float: concentration of the dataset
    """
    item_count = df.groupby('itemID').count().sort_values('userID', ascending=False)
    n_items = len(item_count)
    top_n_items_num = round(n_items*N)
    concentration_interactions = item_count.head(top_n_items_num)['userID'].values.sum()
    total_interactions = len(df)
    concentration = concentration_interactions/total_interactions
    return concentration