title: condition check in pandas dataframe - python
body: <p>Below is my dataframe:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th></th>
  <th>date</th>
  <th>open</th>
  <th>high</th>
  <th>low</th>
  <th>close</th>
  <th>volume</th>
  <th>sma</th>
  <th>sr</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>0</td>
  <td>2021-07-29</td>
  <td>22.5</td>
  <td>22.5</td>
  <td>22.5</td>
  <td>22.5</td>
  <td>5</td>
  <td>NaN</td>
  <td>1</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Now I want to print the value of sma on if it's not NaN.</p>
  <p>Code:</p>
  <pre><code>if (df.loc[df['sr'] == 1]['sma'].values[0] != 'NaN') or (df.loc[df['sr'] == 1]['sma'].values[0] != &quot;nan&quot;):
      print(df.loc[df['sr'] == 1]['sma'].values[0])
  </code></pre>
  <blockquote>
  <p>There should be no output, but it is printing <strong>nan</strong></p>
  </blockquote>