def enrich(self, columns):
""" Merges the original dataframe with corresponding entity uuids based
on the given columns. Also merges other additional information
associated to uuids provided in the uuids dataframe, if any.
:param columns: columns to match for merging
:type column: string array
:return: original dataframe with at least one new column:
* uuid: identity unique identifier
:rtype: pandas.DataFrame
"""
for column in columns:
if column not in self.data.columns:
return self.data
self.data = pandas.merge(self.data, self.uuids_df, how='left', on=columns)
self.data = self.data.fillna("notavailable")
return self.data
评论列表
文章目录