I need to create a column Period_Subcategory based on other columns' values: a dictionary of {Period value: [list of Sub_Category values...]}
Input df:
Period Category Sub_Category
FY18Q1 Clothing Shirt
FY18Q2 Clothing Trouser
FY18Q1 Clothing Shirt
FY18Q3 Clothing Pant
FY18Q1 Accessories Watch
FY18Q2 Accessories Muff
FY18Q2 Accessories Watch
FY18Q3 Accessories Chains
Desired output df_output:
Category Period_Subcategory
Clothing {'FY18Q1':'Shirt','FY18Q2':'Trouser','FY18Q3':'Pant'}
Accessories {'FY18Q1':'Watch','FY18Q2':['muff','Watch'],'FY18Q3':'Chains'}