i have df like this
Contact Number
0
1 NaN
2 6363887122.0
3 6363887122.0
I WANT THIS
Contact Number Status_contactNUmber Invalid_contactNUmber
0 Blank/Null True
1 NaN Blank/Null True
2 6363887122 Valid False
3 6363887122 Valid False
I try with this
def contactNumber(ele):
if (pd.isna(ele) or (ele=='')):
return ("Blank/Null",True)
elif re.search(r'^([0]|\+91)?[6789]\d{9}$',ele):
# elif ele.str.contains(r'^([0]|\+91)?[6789]\d{9}$'):
return ("Valid",False)
else:
return ("invalid",True)
df[['Status_contactNUmber','Invalid_contactNUmber']] = df['Contact Number'].apply(contactNumber).tolist()
but give the Error because Contact Number column in Float
type