def daterange_to_str(daterange):
    """ Takes a pandas DatetimeIndex created by pandas date_range converts it to a
        string of the form 2019-01-01-00:00:00_2019-03-16-00:00:00

        Args:
            daterange (pandas.DatetimeIndex)
        Returns:
            str: Daterange in string format
    """
    start = str(daterange[0]).replace(" ", "-")
    end = str(daterange[-1]).replace(" ", "-")

    return "_".join([start, end])