enrich.py 文件源码

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

项目:ceres 作者: dicortazar 项目源码 文件源码
def enrich(self, column, projects):
        """ This method adds a new column named as 'project'
        that contains information about the associated project
        that the event in 'column' belongs to.

        :param column: column with information related to the project
        :type column: string
        :param projects: information about item - project
        :type projects: pandas.DataFrame

        :returns: original data frame with a new column named 'project'
        :rtype: pandas.DataFrame
        """

        if column not in self.data.columns:
            return self.data

        self.data = pandas.merge(self.data, projects, how='left', on=column)

        return self.data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号