I'm trying to modify and add some columns in an imported csv file. The idea is that I want 2 extra columns, one with the MD5 value of the email address, and one with the SHA256 value of the email.
+----+-----------+---------+
| id | email | status |
| 1 | 1@foo.com | ERROR |
| 2 | 2@foo.com | SUCCESS |
| 3 | 3@bar.com | SUCCESS |
+----+-----------+---------+
I have tryed with
df['email_md5'] = md5_crypt.hash(df[df.email])
This gives me an error saying:
KeyError: "['1@foo.com' '2@foo.com'\n '3@bar.com'] not in index"
I have seen in another post Pandas KeyError: value not in index its suggested to use reindex
, but I can't get this to work.