title: Simplify query to just 'where' by making new column with pandas?
body: <p>I have a column with SQL queries to a column. These are implemented on a function called <code>Select_analysis</code></p>
  
  <p>Form:</p>
  
  <pre><code>Select_analysis (input_shapefile, output_name, {where_clause}) # it takes until where.
  </code></pre>
  
  <p>Example:</p>
  
  <pre><code>SELECT * from OT         # OT is a dataset
  GROUP BY OT.CA  # CA is a number that may exist many times.Therefore we group by that field.
  HAVING ((Count(OT.OBJECTID))&gt;1) # an id that appears more than once.
  </code></pre>
  
  <p>OT dataset</p>
  
  <pre><code>objectid     CA
  1            125
  2            342
  3            263
  1            125
  </code></pre>
  
  <p>We group by CA.</p>
  
  <p>About having: it is applied to the rows that have objectid more than once. Which is the objectid 1 in this example.</p>
  
  <p>My idea is to make another column that will store a result that will be accessed with a simple where clause in the <code>select_analysis</code> function</p>
  
  <p>example: OT dataset</p>
  
  <pre><code>objectid     CA       count_of_objectid_aftergroupby
  1            125           2
  2            342           1
  3            263           1
  1            125           2
  </code></pre>
  
  <p>So then can be:</p>
  
  <pre><code>Select_analysis(roads.shp,output.shp, count_of_objectid_aftergroupby &gt; '1')
  </code></pre>
  
  <p><strong>Notes</strong></p>
  
  <p>it has to be in such a way so that <code>select analysis</code> function is used in the end.</p>