def degree_mean(data: pd.Series) -> float:
    """
    Return the mean of a list of degrees
    """

    if data.isnull().all():
        return np.nan

    rads = np.deg2rad(data)
    sums = np.arctan2(np.sum(np.sin(rads)), np.sum(np.cos(rads)))
    return (np.rad2deg(sums) + 360) % 360

    Return the mean of a list of degrees
    
meteostat/utilities/aggregations.py