title: how to determine if a numpy array or pandas row contains a string?
body: <p>I have a pandas df of floats, but due to improper output/errors from the program from which I received the data, a number of rows contain values that are actually strings.</p>
  
  <p>I want to remove these rows from the df with minimal looping. Ideally, I would like to mask all values in the df to those which are strings, and drop the row with True values. Another would be to iterate through each row and mask each individual row and delete if a True is in the mask. Worst case would be to loop over each row and also loop over each value to achieve the same task.</p>
  
  <p>Can anyone advise how I could do this the most efficiently?</p>
  
  <p>Something akin to df.iloc[x].istype(str) or something?</p>
  
  <p>I tried df.loc[row_num].<strong>contains</strong>(str) as a futile attempt but didn't work.</p>
  
  <p>I know I can loop over every single cell and do isinstance(cell,str) to check if it's a string but would really prefer some kind of masking technique.</p>
  
  <p>As a side note to narrow down any solutions, I don't want to fix any string values to be floats, I just want to delete the entire row.</p>
  
  <p>Thanks in advance.</p>
  
  <p>Example of problematic row is below, notice the string with two decimals:</p>
  
  <pre><code>df.loc[516].values
  
  array([890.0, 33.17, 29.64, 78.355, 80.182, 83.196, 86.721,
         90.12299999999999, 92.807, '91.705.099', 98.89, 99.007,
         99.34200000000001, 99.337, 100.43799999999999, 99.867, '100.625',
         100.712, 100.46, 100.427, 101.16799999999999, 100.904, 100.193,
         100.255, 100.537, 100.37100000000001, 100.535, 100.584, 101.52,
         101.787, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
         nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
         nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
         nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
         nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
         nan], dtype=object)
  </code></pre>