scrapers.py 文件源码

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

项目:carbondoomsday 作者: giving-a-fuck-about-climate-change 项目源码 文件源码
def parse_values(self, entries):
        """Retrieve the values from the data set."""
        values = []
        for entry in entries:
            if not entry:
                continue

            date, daily, _, _ = entry
            try:
                separated = date.split('-', 2)
                intified = map(int, separated)
                co2_date = datetime.date(*intified)
            except (ValueError, TypeError):
                continue

            try:
                co2_ppm = Decimal(daily)
            except InvalidOperation:
                continue

            values.append((co2_date, co2_ppm))

        return values
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号