def get_last_data_idx(productions):
    """
    Find index of the last production
    :param productions: list of 24 production dict objects
    :return: (int) index of the newest data or -1 if no data (empty day)
    """
    for i in range(len(productions)):
        if productions[i]['total'] < 1000:
            return i - 1
    return len(productions) - 1