I have a pandas dataframe and I have a column called 'email'. I have verified the dtype is object. It contains normally formatted emails such as [email protected]
When I do this:
$ df['emaillower'] = df['email'].apply(lambda x: x.lower())
I get this:
Traceback (most recent call last):
File "<ipython-input-153-e951d53133eb>", line 1, in <module>
df['emaillower'] = df['email'].apply(lambda x: x.upper())
File "C:\ProgramData\Anaconda2\lib\site-packages\pandas\core\series.py",
line
2355, in apply
mapped = lib.map_infer(values, f, convert=convert_dtype)
File "pandas\_libs\src\inference.pyx", line 1569, in
pandas._libs.lib.map_infer (pandas\_libs\lib.c:66440)
File "<ipython-input-153-e951d53133eb>", line 1, in <lambda>
df['emaillower'] = df['email'].apply(lambda x: x.upper())
AttributeError: 'float' object has no attribute 'upper'
What is going on?