I am trying to do a Multi level Grouping with end result in List and Dictionary building. So for example if my Dataframe looks like this blow
X Y Z
AAAA BBBB CCCCC
AAAA BBBB DDDDD
AAAA BBBB EEEEE
FFFF GGGG HHHHH
FFFF GGGG IIIII
JJJJ KKKK LLLLL
I am trying to merge Y and Z Columns into Dictionary based on grouping from X and Y. hence the end result be like
P Q
AAAA BBBB:[{CCCCC},{DDDDD},{EEEEE}]
FFFF GGGG:[{HHHHH},{IIIII}]
JJJJ KKKK:[{LLLLL}]
Is this something that is purely achievable by pandas Functions or do i have to loop and then then process ?