title: How to create python function that performs multiple checks on a dataframe?
body: <p>I have multiple inventory tables like so:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>line no</th>
  <th>-1 qty</th>
  <th>-2 qty</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>-</td>
  <td>3</td>
  </tr>
  <tr>
  <td>2</td>
  <td>42.1 FT</td>
  <td>-</td>
  </tr>
  <tr>
  <td>3</td>
  <td>5</td>
  <td>-</td>
  </tr>
  <tr>
  <td>4</td>
  <td>-</td>
  <td>10 FT</td>
  </tr>
  <tr>
  <td>5</td>
  <td>2</td>
  <td>1</td>
  </tr>
  <tr>
  <td>6</td>
  <td>6.7</td>
  <td>-</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>or</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>line no</th>
  <th>qty</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>2</td>
  </tr>
  <tr>
  <td>2</td>
  <td>4.5 KG</td>
  </tr>
  <tr>
  <td>3</td>
  <td>5</td>
  </tr>
  <tr>
  <td>4</td>
  <td></td>
  </tr>
  <tr>
  <td>5</td>
  <td>13</td>
  </tr>
  <tr>
  <td>6</td>
  <td>AR</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want to create logic check for the quantity column using python. (The table may have more than one qty column and I need to be able to check all of them. In both examples, I have the tables formatted as dataframes.)</p>
  <p>Acceptable criteria:</p>
  <ul>
  <li>integer with or without &quot;EA&quot; (meaning each)</li>
  <li>&quot;AR&quot; (as required)</li>
  <li>integer or float with unit of measure</li>
  <li>if multiple QTY columns, then &quot;-&quot; is also accepted (first table)</li>
  </ul>
  <p>I want to return a list per page, containing the line no. corresponding to rows where quantity value is missing (line 4, second table) or does not meet acceptance criteria (line 6, table 1). If the line passes the checks, then return <code>True</code>.</p>
  <p>I have tried:</p>
  <pre><code>qty_col = [col for col in df.columns if 'qty' in col]
  df['corr_qty'] = np.where(qty_col.isnull(), False, df['line_no'])
  </code></pre>
  <p>but this creates the quantity columns as a list and yields the following
  <code>AttributeError: 'list' object has no attribute 'isnull'</code></p>