Add a date column in pandas df using constant value in str
<p>i have a table in pandas df</p>

<pre><code>    product_id_x    product_id_y    count
0   2727846            7872456       1
1   29234              2932348       2
2   29346              9137500       1
3   29453              91365738      1
4   2933666            91323494      1
</code></pre>

<p>i want to add a new column 'dates' which i have defined in a str.</p>

<pre><code>dateSelect = "'2016-11-06'"
</code></pre>

<p>so i added a new constant column</p>

<pre><code>df['dates'] = dateSelect 
</code></pre>

<p>but i am getting result as </p>

<pre><code>   product_id_x   product_id_y    count   dates
0   2727846          7872456         1  '2016-11-06'
1   29234            2932348         2  '2016-11-06'
2   29346            9137500         1  '2016-11-06'
3   29453            91365738        1  '2016-11-06'
4   2933666          91323494        1  '2016-11-06'
</code></pre>

<p>the values in the dates are coming in quotes. and </p>

<pre><code>type(df['dates']) = str
</code></pre>

<p>but i want it in date format, because further i am going to store this table in my mysql database. and i want the type to be date.</p>

<pre><code>from sqlalchemy import create_engine
engine = create_engine('mysql+mysqldb://name:pwd@xxx.xx.xx.x/dbname', echo=False)
df.to_sql(name='tablename', con=engine, if_exists = 'append', index=False)
</code></pre>