def A_i_cumul_opps(i, D, lu, tt_max, df_tt):
    """Calculate the accessibility of a single zone i, using a cumulative opportunities measure. 
    Args: 
        i (str): id of origin zone
        D (DataFrame): dataframe with values of destination activities, and taz id's as index. 
        lu (str): name of land use activities column
        tt_max (float or int): maximum travel time, i.e., travel time cutoff
        df_tt (DataFrame): matrix of travel times for the given mode and year. 
    Returns: 
        float: Accessibility of zone i. 
    """
    J = df_tt.ix[i][df_tt.ix[i]<=tt_max].index  # find set of zones J reachable within max ttime. 
    return D.ix[J].sum()[lu]