title: Appending to a Pandas Dataframe From a pd.read_sql Output
body: <p>I'm coming from R but need to do this in Python for various reasons.
  This very well could be a basic PEBKAC issue with my Python more than anything with Pandas, PyODBC or anything else. </p>
  
  <p>Please bear with me.</p>
  
  <p>My current Python 3 code:</p>
  
  <pre><code>import pandas as pd
  import pyodbc 
  cnxn = pyodbc.connect(DSN="databasename", uid = "username", pwd = "password")
  
  querystring = 'select order_number, creation_date from table_name where order_number = ?'
  
  orders = ['1234',
  '2345',
  '3456',
  '5678']
  
  for i in orders:
     print(pd.read_sql(querystring, cnxn, params = [i]))
  </code></pre>
  
  <p>What I need is a dataframe with the column names of "order_number" and "creation_date." </p>
  
  <p>What the code outputs is:
  <a href="https://i.stack.imgur.com/A7Vd3.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/A7Vd3.jpg" alt="enter image description here"></a></p>
  
  <p>Sorry for the screenshot, couldn't get the formatting right here.</p>
  
  <p>Having read the <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.append.html" rel="noreferrer">dataframe.append page</a>, I tried this:</p>
  
  <pre><code>df = pd.DataFrame()
  
  for i in orders:
         df.append(pd.read_sql(querystring, cnxn, params = [i]))
  </code></pre>
  
  <p>That appears to run fine (no errors thrown, anyway). </p>
  
  <p>But when I try to output df, I get</p>
  
  <pre><code>Empty DataFrame
  Columns: []
  Index: []
  </code></pre>
  
  <p>So surely it must be possible to do a pd.read_sql with params from a list (or tuple, or dictionary, ymmv) and add those results as rows into a pd.DataFrame(). </p>
  
  <p>However, I am failing either at my Stack searching, Googling, or Python in general (with a distinct possibility of all three). </p>
  
  <p>Any guidance here would be greatly appreciated. </p>