Appending domain name in the csv data rows after finding which rows does not have the domain after user name

Ddevil Prasad Source

I have a data set which contains email address column and some of its values does not contain the "" string. how can I append this string to those values after finding them in the dataset I have tried to find the rows that have the string in it, as a newbie, following is the code

        import re
        import pandas as pd
        xx = ""
        r1 = re.findall(r"^\w+",xx)


answered 8 months ago mrzasa #1

You can try to iterate and use good old if and endswith (no regexps). I prepared a simple example (no CSV):

t = ['a', 'b', '[email protected]']
for i, s in enumerate(t):
    if not s.endswith(''):
        t[i] = s + ''


comments powered by Disqus