def timefilter(df, daterange, inplace=True):
    """removes rows with dates outside of the daterange from self.df
    Parameters
    ----------
    daterange:  tuple
              (datetime, datetime)
    inplace: boolean
              if TRUE then replaces self.df attribute
    """
    df = df[df["time"] > daterange[0]]
    df = df[df["time"] < daterange[1]]
    return df