I couldn't find another thread with the exact same question, so I hope, I'm not opening too much of the same old one.
I'm just learning to work with pandas and date time objects and I'm looking to create a big DatetimeIndex object with a range of dates and after that, calculate the difference set between the big one and several smaller ones, but I'm running into an error here:
range1 = pd.date_range(start="2015-01-01", end="2015-02-01")
range2 = pd.date_range(start="2015-01-03", end="2015-01-07")
range3 = pd.date_range(start="2015-01-13", end="2015-01-20")
range = range1 - range2 - range3
print(range)
ValueError: cannot add indices of unequal length
I was hoping the above code would give me the date range between the given points minus the dates of the following ranges, but I'm stuck here. Could someone explain, please?