使用字典中的键值将列添加到 pandas.Dataframe

Dea*_*ean 2 python dictionary pandas

我有以下数据框:

在此输入图像描述

我有以下字典:

resource_ids_dict = {'Austria':1586023272, 'Bulgaria':1550004006, 'Croatia':1131119835, 'Denmark':1703440195, 
                     'Finland':2005848983, 'France':1264698819, 'Germany':1907737079, 'Greece':2113941104, 
                     'Italy':27898245, 'Netherlands':1832579427, 'Norway':1054291604, 'Poland':1188865122, 
                     'Romania':270819662, 'Russia':2132391298, 'Serbia':1155274960, 'South Africa':635838568, 
                     'Spain':52600180, 'Switzerland':842323896, 'Turkey':1716131192, 'UK':199152257}
Run Code Online (Sandbox Code Playgroud)

我正在使用上述字典来调用供应商 API。然后,我将所有返回数据附加到 dataframe 中df

我现在想做的是在后面添加一列,ID该列是位于 中的字典值的字典ResourceSetID

我在网上查了一下,但没有找到任何东西(可能是因为我缺乏准确的关键词搜索)。这肯定应该是一句单行话吧?我想避免循环遍历数据框和字典并以这种方式映射。