Aggregate based on each item in a special character seperated column in Pandas
问题 I have input data as given below 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 The input to my function is Medium. It could be a single value of a list. I want to search the data based on Medium input and then aggregate the data as given below. For