S
for country in alpha_codes:
s1.append(df[(df['Phone No_'].apply(phone_number_is_valid(country=country)) == True)])
Size: a a a
S
S
ᅠ
def phone_number_is_valid(number, **kwargs):
"""Given a phone number and a country code, returns True if the phone number is valid, otherwise False."""
#ensure_definition(number, country)
try:
pn = phonenumbers.parse(number, country)
except:
return False
if phonenumbers.is_possible_number(pn) and phonenumbers.is_valid_number(pn):
return True
return False
s1 = pd.Series([])
for country in alpha_codes:
s1.append(df[(df['Phone No_'].apply(phone_number_is_valid(country='{}'.format(country))) == True)])
phone_number_is_valid
?S
ᅠ
K
S
ᅠ
ᅠ
S
ᅠ
<Ч
ᅠ
ᅠ
K
S
ᅠ
S
МБ