def get_index_by_days_dict(timestamps: pd.DatetimeIndex, dates = None): """Create dictionary with dates as index an intraday timestamps as values """ if(dates is None): dates = timestamps.map(pd.Timestamp.date) indexes_by_day_dict = timestamps.groupby(dates) return indexes_by_day_dict
def get_timestamps_by_trading_session_dict(self, timestamps: pd.DatetimeIndex): """Create dictionary with dates as index an intraday timestamps as values """ ## TODO: Take iso into consideration here. dates = timestamps.map(pd.Timestamp.date) indexes_by_day_dict = timestamps.groupby(dates) return indexes_by_day_dict