I am trying to add a new column to a dataframe with the word "foo" if found in "column1" but don't want to add it and leave the value empty if let's say the word "bar" is found. I have tried to add & to the statement below but it does not work.
import pandas as pd
import numpy as np
df = pd.read_csv('newdoc.csv')
df['new_column'] = np.where(df['column1'].str.contains("foo", case=False, na=False), 'Foo', '')