I'm making analyses of different files with userinformationer (from AD dumps and Excel files), and i need to exchange data between them. And i would like to learn it the Pandas way.
I have been searching the net, and i can not find a way to do it - probably because i do not use the proper terminology
Or do i have to export to a dictionary and then fetch values from there?
... and how do i do that?
or even worse ... do i have to parse the csv file line for line to achieve this goal?
It would make my day to now how to do that
pseudo example code
if df1["Username"] == df2["User"]:
insert df2["Email"] in df1["Email"]
else:
do nothing
or practical example:
df1 = pd.DataFrame({
"UserName":["B-01","B-02","B-03","B-04","B-05"],
"RealName":["Ann","Bono","Cara","Dylan","Eva"],
})
df2 = pd.DataFrame({
"User":["B-02","B-04","B-05"],
"Email":["mail1@example.org","mail2@example.org","mail3@example.org"]
})
OUTPUT:
UserName RealName
0 B-01 Ann
1 B-02 Bono
2 B-03 Cara
3 B-04 Dylan
4 B-05 Eva
User Email
0 B-02 mail1@example.org
1 B-04 mail2@example.org
2 B-05 mail3@example.org,
Result from code
UserName RealName Email
0 B-01 Ann NaN
1 B-02 Bono mail1@example.org
2 B-03 Cara NaN
3 B-04 Dylan mail2@example.org
4 B-05 Eva mail3@example.org