I have a pandas dataframe where one column contains only strings.

```
df= pd.DataFrame(
  {
    "A": [2,4,7,17,39], 
    "B": ["apple","apple","broccoli","rose","apple"]
  }
)

```

I want to examine this column "B" and look for all the times a string contains a certain part of a word. Then I create a new column "C" that contains a series of strings that say "fruit" whenever "app" is in the row,"flower" for whenever "ros" shows up and vegetable for whenever "brocc" shows up.

The final dataframe will look like:

```
df= pd.DataFrame(
  {
    "A": [2,4,7,17,39], 
    "B": ["apple","apple","broccoli","rose","apple"], 
    "C": ["fruit","fruit", "vegetable", "flower", "fruit"]
  }
)

```