def experiment_pivot_table(experiment_snapshots_df,
                           per_benchmark_ranking_function):
    """Creates a pivot table according to a given per benchmark ranking, where
    the columns are the fuzzers, the rows are the benchmarks, and the values
    are the scores according to the per benchmark ranking."""
    benchmark_blocks = experiment_snapshots_df.groupby('benchmark')
    groups_ranked = benchmark_blocks.apply(per_benchmark_ranking_function)
    num_benchmarks = groups_ranked.shape[0]
    pivot_df = groups_ranked if num_benchmarks == 1 else groups_ranked.unstack()
    return pivot_df