p1c1.py 文件源码

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

项目:pyrsss 作者: butala 项目源码 文件源码
def __init__(self, p1c1_fname=P1C1_FNAME):
        """
        Parse *p1c1_fname* and store DCB (in [TECU]) in the mapping
        :class:`datetime` -> ['svn', 'prn'] -> integer ID.
        """
        super(P1C1Table, self).__init__()
        if p1c1_fname == P1C1_FNAME and not os.path.isfile(p1c1_fname):
            update_p1c1()
        with open(p1c1_fname) as fid:
            for line in fid:
                if line.startswith('#'):
                    continue
                cols = line.split()
                date = datetime.strptime(cols[0], '%Y-%m-%d')
                prn = int(cols[1])
                svn = int(cols[2])
                CA_P_m = float(cols[3])
                self.setdefault(date, {}).setdefault('prn', {})[prn] = CA_P_m
                self[date].setdefault('svn', {})[svn] = CA_P_m
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号