熊猫数据框,其日期范围需要过滤
print(df_dates)
Type Entry Exit
0 2008-03-03 2008-03-17
1 2010-05-19 2010-06-10
我的尝试
没有错误,但Dask数据帧未过滤
dd_str = "dd_to_filter['date']"
filter_mask = ' | '.join(f'({dd_str}>=\'{start}\') & ({dd_str}<=\'{stop}\')' for start,stop in zip(dd_dates['Entry'],df_dates['Exit']))
dd_to_filter = dd_to_filter[eval(filter_mask)]