def new(x):
    new_dict = dict(a=1, b=2)
return new_dict.get(x, 4)
df = pd.DataFrame([['new1', 'a'], ['new2', 'b'], ['new3', 'c'], ['new4',
    'd'], ['new5', 'b']], columns=['new', 'id'])
pandas match dict 'else'