Python手機號碼歸屬地查詢

pip install phone #安裝phone包


import phone


phone.Phone().find('00000000000')


{'area_code': '0531',
 'city': '濟南',
 'phone': '00000000000',
 'phone_type': '聯通',
 'province': '山東',
 'zip_code': '250000'}


import phone
def city(x):
    s='未知'
    try:
        s=phone.Phone().find(x)['city']
    except:
        pass
    return s
df1['城市']=df1.consignee_phone.map(city)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章