I have some df
with dates as the index. I need to aggregate over unique pair of dates. Thus, basically, I need to choose only two dates in the df
, coming from the itertools.combinations()
function. Notice I don't need the range but I need to filter for the two exact dates. Here's my solution, but it doesn't work.
Dtest = ['2019-09-23', '2019-09-24']
for pair in itertools.combinations(Dtest, 2):
print(pair)
tframe = df[(df.iloc(pair[0]) | df.iloc(pair[1])) ]