def build_dataframe(
    datetime_utc: List[int],
    energy_consumption_values: List[float],
    values_column_name: str = "energy_consumption",
):
    """
    Build DataFrame for plotting from timestamps and energy consumption values.

    Args:
        datetime_utc (List[int]): list of timestamp values in UTC
        values (List[float]): list of energy consumption values
        values_column_name (str): name of the column containing the values
    """

    df = pd.DataFrame(
        list(zip(datetime_utc, energy_consumption_values)),
        columns=["datetime_utc", values_column_name],
    )
    df["datetime_utc"] = pd.to_datetime(df["datetime_utc"], unit="h")

    # Resample to hourly frequency to make the data continuous.
    df = df.set_index("datetime_utc")
    df = df.resample("H").asfreq()
    df = df.reset_index()

    return df

    Build DataFrame for plotting from timestamps and energy consumption values.

    Args:
        datetime_utc (List[int]): list of timestamp values in UTC
        values (List[float]): list of energy consumption values
        values_column_name (str): name of the column containing the values
    
app-monitoring/monitoring/components.py