how to replace a dataframe row with NaN if it doesn't contain a specific string : <p><a href="https://i.stack.imgur.com/3HDdv.png" rel="nofollow noreferrer">dataframe</a></p>

<p>I am working with the data frame shown in the link above.  I want to make all rows that do not contain the words 'Yes' or 'No' be replaced with NaN.</p>
