Код: Выделить всё
import wbgapi as wb
gdppercap=wb.data.DataFrame('NY.GDP.PCAP.CD', wb.region.members('WLD'))
# how do I pass the coder function to the rename method here, so that it returns the "WBG NAME"?
gdppercap['YR2021'].sort_values(ascending = False).rename(index = wb.economy.coder)
Код: Выделить всё
wb.economy.coder(['ARG', 'Korea'])
ORIGINAL NAME WBG NAME ISO_CODE
ARG Argentina ARG
Korea Korea, Rep. KOR
Подробнее здесь: https://stackoverflow.com/questions/757 ... untry-name
Мобильная версия