I do as below
mapper = {'a': 'b', 'c': nan, 'd': 'e', nan : nan}
df['b'] = [ mapper[x] for x in df['a'] ]
df['b'].value_counts()
and
NameError Traceback (most recent call last)
<ipython-input-48-3862b2347ce7> in <module>()
NameError: name 'nan' is not defined
What's wrong? Is a mistake in coding or in file?