【发布时间】:2021-09-22 23:04:01
【问题描述】:
我有以下字典和系列。
product_type_dic = {'Facial Care':['Facial_cleanser', 'Beard_oil'], 'Eye Care':['Around-eye_cream', 'Eyeliner']}
s = pd.Series(['Facial_cleanser', 'Beard_oil', 'Around-eye_cream', 'Eyeliner'])
我的目标是使用 Series 获取字典的键值。 所以结果会是
'Facial Care'
'Facial Care'
'Eye Care'
'Eye Care'
谢谢
【问题讨论】:
标签: pandas dictionary series