I have a data frame with a column message, and I want to create a column media such that if for index x, df.ix[x][message]=="<Media omitted>" ,then I want df.ix[x][media] = 1
for example for the dataframe:
index message
1 hello
2 <Media omitted>
3 hello
4 <Media omitted>
I would get:
index message media
1 hello 0
2 <Media omitted> 1
3 hello 0
4 <Media omitted> 1
I tried to do so only by using a loop, but I'm sure there is a smarter and faster way.