alex_bn_lee

导航

【855】country converter, ISO alpha 3

Ref: country-converter 1.0.0

Ref: Python-pycountry | Understand How to Use pycountry


These two python libraries are both used to process information about country names. For the library of country-converter, it can be used to convert the dirty data (country names with different writting types) to the nomalized type.

Example:

import country_converter as coco
some_names = ['United Rep. of Tanzania', 'DE', 'Cape Verde', '788', 'Burma', 'COG',
              'Iran (Islamic Republic of)', 'Korea, Republic of',
              "Dem. People's Rep. of Korea"]
standard_names = coco.convert(names=some_names, to='name_short')
print(standard_names)

 

posted on 2023-07-09 11:12  McDelfino  阅读(21)  评论(0)    收藏  举报