I have a dataframe composed of 2 columns Let's say the 2 columns are idencrypted and num. I use a function decrypt that decrypt column idencrypted and takes 2 other arguments (2 keys of encryption). I would like to replace the current df or make a new dataframe composed of the id decrypted and the num. My decrypt function take only string as an entry , that is why I am using a loop like this, and return a string : Decrypt ('idencrypted', key1, iv)
So I would like a df with id and num column, do you know how can I do? Thanks !
Here is my example:
Here is the function decrypt i am using and that is working:
for text in ['AAA', 'BBB', 'CCC']:
print "original:", text
dec = decrypt(text,key,iv)
print "decrypted:", dec
Output:
original: 'AAA'
decrypted: user-111
original: 'BBB'
decrypted: user-222
But now i have a dataframe as an entry and i would like to put the result in a dataframe.
Example of my dataframe in entry:
df=getDataFromDB(engine)
The df is composed of 2 columns : idencrypted (like 'AAA','BBB') and num_col_completed (like '1','2','3')
What i would like as an output is a dataframe with:
iddecrypted splited from 'user-' : ('111','222')
and the num_col_completed : '1','2','3'
so that i can do joins with this dataframe and others after.
I know that i can do the split with : .split("-")[1]
But i do not succeed decrypt all the dataframe ids to an other dataframe