# A new column is created and populated based on conditions applying to the CommentsLow column
# If a string is found in CommentsLow, a new flag value will be created in the Success label column
# It is a good practice to set all strings to lower case
df["CommentsLow"] = df["Comments"].str.lower()
# If the string "stopped" or "terminated" is found then the "Failed" label will be applied, otherwise the "OK" label will be used
df["Success label"] = pd.np.where(df["CommentsLow"].str.contains("stopped"), "Failed",
pd.np.where(df["CommentsLow"].str.contains("terminated"), "Failed", "OK"))