I created a dictionary with values such as 2100 and 97AK. I created a dataframe to have values mapped to the dictionary. The values that have mixed numbers and letters are found but all the integers ones are returned as NaN. What could cause the failure of recognizing dictionary values?
abbreviations = {'1700':'Navy',
'2100': 'Army',
'5700': 'AF',
'9700': 'DOD',
'9736': 'NA',
}
import pandas as pd
import numpy as np
df = pd.read_excel("fun.xlsx")
columns = ['a', 'bc']
df1 = pd.DataFrame(df, columns=columns)
df1["b"] = df1["ac"].map(abbreviations)
print(df1)