calculate_active_hours

calculate_active_hours(df: pandas.DataFrame) dict[str, int][source]

Calculates the total active hours for different entities based on a DataFrame.

The DataFrame is expected to have ‘name’ and ‘active’ columns.

Parameters:

df (pd.DataFrame) – Input dataframe with schedule information.

Returns:

Dictionary mapping names to total active hours.

Return type:

dict[str, int]