title: Creating an empty Pandas DataFrame, and then filling it
body: <p>I'm starting from the pandas DataFrame documentation here: <em><a href="http://pandas.pydata.org/pandas-docs/stable/dsintro.html" rel="nofollow noreferrer">Introduction to data structures</a></em></p>
  <p>I'd like to iteratively fill the DataFrame with values in a time series kind of calculation. So basically, I'd like to initialize the DataFrame with columns A, B and timestamp rows, all 0 or all NaN.</p>
  <p>I'd then add initial values and go over this data calculating the new row from the row before, say <code>row[A][t] = row[A][t-1]+1</code> or so.</p>
  <p>I'm currently using the code as below, but I feel it's kind of ugly and there must be a  way to do this with a DataFrame directly, or just a better way in general.</p>
  <p>Note: I'm using Python 2.7.</p>
  <pre><code>import datetime as dt
  import pandas as pd
  import scipy as s
  
  if __name__ == '__main__':
      base = dt.datetime.today().date()
      dates = [ base - dt.timedelta(days=x) for x in range(0,10) ]
      dates.sort()
      
      valdict = {}
      symbols = ['A','B', 'C']
      for symb in symbols:
          valdict[symb] = pd.Series( s.zeros( len(dates)), dates )
          
      for thedate in dates:
          if thedate &gt; dates[0]:
              for symb in valdict:
                  valdict[symb][thedate] = 1+valdict[symb][thedate - dt.timedelta(days=1)]
              
      print valdict
  </code></pre>