I am trying to map data using a list instead of a string
If the number is inside the list, then map it to xyz
Any way I can do this using a list?
import pandas as pd
df = pd.DataFrame({'INDICATOR': ['0001024561', 'B', '0001024561', 'D'], 'VALUE': [10, 9, 8, 7]})
company_dict = {[
'0001024561',
'0001024576',
]: 'xyz'}
df['NEW_VALUE'] = df['INDICATOR'].map(company_dict)
print(df)
Error:
TypeError: unhashable type: 'list'