timeseries.py 文件源码

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

项目:Thymus-timeseries 作者: sidorof 项目源码 文件源码
def fmt_date(numericdate, dt_type, dt_fmt=None):
        """
        This static method accepts a date and converts it to
        the format used in the timeseries.
        """
        if dt_type == TS_ORDINAL:
            if dt_fmt is None:
                dt_fmt = FMT_DATE
            return datetime.fromordinal(int(numericdate)).strftime(dt_fmt)
        elif dt_type == TS_TIMESTAMP:
            if dt_fmt is None:
                dt_fmt = FMT_IDATE
            return datetime.fromtimestamp(numericdate).strftime(dt_fmt)
        else:
            raise ValueError("Unknown dt_type: %s" % dt_type)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号