def meandatetime(datetimes):
    """
    calculate the average date from a given list of datetime-objects
    (can be applied to a pandas-Series via Series.apply(meandatetime))

    Parameters:
    ------------
    datetimes: list
               a list of datetime-objects
    Returns:
    ---------
    meandate: Timestamp
              the center-date
    """
    if len(datetimes) == 1:
        return datetimes[0]
    x = datetimes
    deltas = (x[0] - x[1:]) / len(x)
    meandelta = sum(deltas)
    meandate = x[0] - meandelta
    return meandate
