import logging


def get_channels_avgs(channels):
    """Compute average values for all keys in given dict of channels."""
    output = dict()
    for channel in channels.keys():
        try:
            output[channel] = sum(channels[channel])/len(channels[channel])
        except ZeroDivisionError:
            logging.error("get_channels_avg: this epoch has empty channel " + channel + ".")
            output[channel] = 0
    return output