def dfadaptDateRange(df, start_date, end_date):
    """Slices dataframe keeping values between start-date and end_date

    Parameters:
    -----------
    -df : Pandas DataFrame
        the dataset, asuming that it is sorted by date (with "Date_code")
    -start_date : str 
        format : YYYY MM DD
    -end_date : str 
        format : YYYY MM DD

    Returns:
    -----------
        The coresponding dataset (pandas DataFrame)
    """

    day1, month1, year1 = start_date[8:10], start_date[5:7], start_date[:4]
    day2, month2, year2 = end_date[8:10], end_date[5:7], end_date[:4]

    datecode1, datecode2 = int(year1 + month1 + day1), int(year2 + month2 + day2)

    df0 = df[df['Date_code'] <= datecode2]
    df0 = df0[df0['Date_code'] >= datecode1]

    return df0