Answer the question
In order to leave comments, you need to log in
How can I iterate over a certain column in a DATAFRAME in a loop?
We have a Dataframe
Unnamed: 0 FUL MAIL DRT RUM dt
4 4 Ivanov5 [email protected] 1.05 3 2020-05-01
5 6 Ivanov7 [email protected] 5.08 4 2020-08-05
Roughly speaking, I need to go through the MAIL column of her values and substitute in the address of the recipient.
mailto: $mail substitute all values from the MAIL column here
Answer the question
In order to leave comments, you need to log in
>>> df = pd.DataFrame([{'name': 'example', 'email': '[email protected]'}, {'name': 'example2', 'email': '[email protected]'}])
>>> df
name email
0 example [email protected]
1 example2 [email protected]
>>> for _, row in df.iterrows():
... row['email']
...
'[email protected]'
'[email protected]'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question