I have data frame and I try to replace it from other df
I use:
df['term_code'] = df.search_term.map(rep_term.set_index('search_term')['code_action'])
But I get an error:
File "C:/Users/����� �����������/Desktop/projects/find_time_before_buy/graph (2).py", line 36, in <module>
df['term_code'] = df.search_term.map(rep_term.set_index('search_term')['code_action'])
File "C:\Python27\lib\site-packages\pandas\core\series.py", line 2101, in map
indexer = arg.index.get_indexer(values)
File "C:\Python27\lib\site-packages\pandas\indexes\base.py", line 2082, in get_indexer
raise InvalidIndexError('Reindexing only valid with uniquely'
pandas.indexes.base.InvalidIndexError: Reindexing only valid with uniquely valued Index objects
What should I change?
Where search_term is
729948 None
729949 None
729950 None
729951 пансионат джемете отдых 2016 цены
729952 None
729953 None
729954 купить телефон
729955 None
729956 вк
729957 None
729958 яндекс
And rep_term looks like
search_term code_action
авито 6
вк 9
яндекс 12
мтс 7
связной 8
ситилинк 8