feature_collection.py 文件源码

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

项目:memex-dossier-open 作者: dossier 项目源码 文件源码
def __iadd__(self, other):
        '''
        In-place add features from two FeatureCollections.

        >>> fc1 = FeatureCollection({'foo': Counter('abbb')})
        >>> fc2 = FeatureCollection({'foo': Counter('bcc')})
        >>> fc1 += fc2
        FeatureCollection({'foo': Counter({'b': 4, 'c': 2, 'a': 1})})

        Note that if a feature in either of the collections is not an
        instance of :class:`collections.Counter`, then it is ignored.
        '''
        if self.read_only:
            raise ReadOnlyException()
        fc = self.merge_with(other, operator.iadd)
        self._features = fc._features
        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号