I have a dataframe which has the Material Types
Column.
I have a dictionary for {'Material type, Value}
.
Now when I try to add a column MAD_PER_MATERIAL
using Dictionary mapping for the same column Material types, I am getting NANs in the new column formed.
d=b.set_index('Material_Types').to_dict()
df["MAD_PER_MATERIAL"] = df["MATERIAL_Types"].map(d)