I have a Data table that has comma separated columns. I want to group by data based on each value in the comma separated column.
Date Investment Type Medium
1/1/2000 Mutual Fund, Stocks, Fixed Deposit, Real Estate Own, Online,Through Agent
1/2/2000 Mutual Fund, Stocks, Real Estate Own
1/3/2000 Fixed Deposit Online
1/3/2000 Mutual Fund, Fixed Deposit, Real Estate Through Agent
1/2/2000 Stocks Own, Online, Through Agent
I have to group by Medium and Investment type as given below. The Medium is given as input to the software I am writing.
Medium Investment Type Date
Online Stocks 1/2/2000,1/1/2000
Own Mutual Fund 1/1/2000,1/3/2000
I have done search using the input I receive and I do get the results. But I am not able to get into the aggregated format that I want. I am new to Python and Pandas. Appreciate your help. Thanks