Skip to content Skip to sidebar Skip to footer

My CSV File Have Some Email Addresses. Some Of Them Have Incomplete Address. How Do I Make Them Fully Recognizable Using Python?

I'm a begineer in data science with python. I'm working on a Dataset in which i've to do following tasks: Using the Python petl: a. clean the data in the clinics.csv. This involve

Solution 1:

I hope this will help assuming you have similar domain for all email ids:

import pandas as pd

df=pd.read_csv("clinic_locations.csv")  #Provide complete path to your file

df['Email']=df['Email'].apply(lambda x: x if '@' in str(x) else str(x)+'@myclinic.com.au')

#To see data frame
print(df.head(10))

Post a Comment for "My CSV File Have Some Email Addresses. Some Of Them Have Incomplete Address. How Do I Make Them Fully Recognizable Using Python?"