date_set.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:InplusTrader_Linux 作者: zhengwsh 项目源码 文件源码
def contains(self, order_book_id, dates):
        try:
            s, e = self._index[order_book_id]
        except KeyError:
            return [False] * len(dates)

        def _to_dt_int(d):
            if isinstance(d, (int, np.int64, np.uint64)):
                if d > 100000000:
                    return int(d // 1000000)
            else:
                return d.year*10000 + d.month*100 + d.day

        date_set = self._get_set(s, e)

        return [(_to_dt_int(d) in date_set) for d in dates]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号