def get_results_df(
    eval_results_list: List[Dict[str, List[EvaluationResult]]],
    names: List[str],
    metric_keys: List[str],
) -> Any:
    """
    Get results df.

    Args:
        eval_results_list (List[Dict[str, List[EvaluationResult]]]):
            List of evaluation results.
        names (List[str]):
            Names of the evaluation results.
        metric_keys (List[str]):
            List of metric keys to get.

    """
    try:
        import pandas as pd
    except ImportError:
        raise ImportError(
            "Pandas is required to get results dataframes. Please install it with `pip install pandas`."
        )

    metric_dict = defaultdict(list)
    metric_dict["names"] = names
    for metric_key in metric_keys:
        for eval_results in eval_results_list:
            mean_score = np.array(
                [r.score or 0.0 for r in eval_results[metric_key]]
            ).mean()
            metric_dict[metric_key].append(mean_score)
    return pd.DataFrame(metric_dict)

    Get results df.

    Args:
        eval_results_list (List[Dict[str, List[EvaluationResult]]]):
            List of evaluation results.
        names (List[str]):
            Names of the evaluation results.
        metric_keys (List[str]):
            List of metric keys to get.

    
llama-index-core/llama_index/core/evaluation/eval_utils.py