title: Python(Pandas) fills blanks cells
body: <p>I am using Python(Pandas) to manipulate high frequency data. Basically, I need to fill the blank cells. </p>
  
  <p>If the this row is blank, then this row will be filled in with the previous existed observation.</p>
  
  <p>My original data example:</p>
  
  <pre><code>Time    bid    ask    
  15:00    .      .
  15:00    .      .
  15:02    76     .
  15:02    .      77
  15:03    .      .
  15:03    78     .
  15:04    .      .
  15:05    .      80
  15:05    .      .
  15:05    .      .
  </code></pre>
  
  <p>needs to converted to</p>
  
  <pre><code>Time    bid    ask    
  15:00    .      .
  15:00    .      .
  15:02    76     .
  15:00    76     77
  15:00    76     77
  15:00    78     77
  15:00    78     77
  15:00    78     80
  15:05    78     80
  15:05    78     80
  </code></pre>
  
  <p><strong>This is my code:</strong></p>
  
  <pre><code>#Import
  tan=pd.read_csv('sample.csv')
  
  #From here fill the blank cells
  
  first_line = True
  mydata = []
  with open(tan, 'rb') as f:
      reader = csv.reader(f)
  # loop through each row...
  for row in reader:
      this_row = row
      # now do the blank-cell checking...
      if first_line:
          for colnos in range(len(this_row)):
              if this_row[colnos] == '':
                  this_row[colnos] = 0
          first_line = False
      else:
          for colnos in range(len(this_row)):
              if this_row[colnos] == '':
                  this_row[colnos] = prev_row[colnos]
      mydata.append( [this_row] )
      prev_row = this_row
  </code></pre>
  
  <p>However, the code does not work.</p>
  
  <p>System indicates: </p>
  
  <pre><code>TypeError: coercing to Unicode: need string or buffer, DataFrame found
  </code></pre>
  
  <p>I really appreciated if your can help me to solve this issue. Thanks.</p>