title: How would you add a time stamp column to a Pandas dataframe?
body: <p>Every time I append a dataframe to a text file, I want it to contain a column with the same timestamp for each row. The timestamp could be any arbitrary time as long as its different from next time when I append a new dataframe to the existing text file. Below code inserts a column named TimeStamp, but doesn't actually insert datetime values. The column is simply empty. I must be overlooking something simple. What am I doing wrong?  </p>
  
  <pre><code>t = [datetime.datetime.now().replace(microsecond=0) for i in range(df.shape[0])]
  s = pd.Series(t, name = 'TimeStamp')
  df.insert(0, 'TimeStamp', s)
  </code></pre>