I have a relatively simple dataframe that looks like this (see below). One of the columns, "Book", is a list of strings.
My goal is to make new dataframes for each of the three distinct values in "Book". That is to say, a dataframe with every product that appears in International, every product that appears in Domestic, and Subscription.
I don't know how to make a new dataframe that is built from matching partial strings in an existing dataframe. Is there a built in functionality for this, or should I build a loop that iterates over the dataframe, and build a new one by that?
df
    Description      Book                               Product ID
0   Products      International, Domestic                 X11
1   Products      International                           X12
2   Products      Domestic                                X13
3   Products      Domestic, International                 X21
4   Services      Subscription, Domestic                  X23
5   Services      International, Domestic                 X23
6   Services      Subscription, International, Domestic   X25
I have tried using different combinations of Pandas isin functionality, but that requires you knowing the exact string you are looking for. In my case, Book column can have any order of the three values, and I have been unable to use isin successfully because of that.
An example of a loop I was trying is:
f = []
for index,row in df.iterrows():
    if "International" in row['Book']:
        f.append 
However this creates an empty list and I know that is in't right. I am not so strong building loops over dataframes, and any advice is greatly appreciated.
My goal output would be dataframes that look like this:
df
    Description      Book                               Product ID
0   Products      International                           X11
1   Products      International                           X12
2   Products      International                           X21
3   Services      International                           X23
4   Services      International                           X25
And
df
    Description   Book                               Product ID
0   Products      Domestic                                X11
2   Products      Domestic                                X13
3   Products      Domestic                                X21
4   Services      Domestic                                X23
5   Services      Domestic                                X25
And same for Subscription. I have looked at multiple other SO questions and been unable to find one that would help in this situation.
 
     
     
    