title: How to skip NaN values in a loop?
body: <p>On my dataset, i have a column as below:</p>
  
  <pre><code>hist = ['A','FAT',nan,'TAH']
  </code></pre>
  
  <p><strong>Then i should use a loop to obtain the cells which contains an</strong> <code>'A'</code>. Here is my code:</p>
  
  <pre><code>    import numpy as np
      import pandas as pd
      import math
      from numpy import nan
  
      for rowId in np.arange(dt.shape[0]):
          for hist in np.arange(10):
              if math.isnan(dt.iloc[rowId,hist])!=True:
                  if 'A' in dt.iloc[rowId,hist]:
                      print("A found in: "+str(dt.iloc[rowId,hist]))
  </code></pre>
  
  <p>In the line <code>if 'A' in dt.iloc[rowId,hist]</code>
   when the value of <code>dt.iloc[rowId,hist]</code> is <code>NAN</code> then it complains with, <code>TypeError: argument of type 'float' is not iterable</code></p>
  
  <p>so i decided to add if <code>math.isnan(dt.iloc[rowId,hist])!=True:</code>
  But, also this one leads to the below error:</p>
  
  <pre><code>TypeError: must be real number, not str
  </code></pre>
  
  <p><strong><em>How may i find the values which contains 'A'?</em></strong></p>