title: How to assign a dataframe?
body: <p>I am new to panda, and I am struggling with something that should be very easy.</p>
  
  <p>I want to define a script that "collects" some data and stores it in a df called repes when some criteria are met.</p>
  
  <p>This is the code:</p>
  
  <pre><code>repes=pd.DataFrame()
  for a in df:
      if a.field==
  
  def rarea(x):
      proximo=df[(df.lat&gt;float(x.lat)-0.001)&amp;(df.lat&lt;float(x.lat)+0.001)]
      if len(proximo)==1:
          p2 = proximo.coordenadas
          return len(proximo)
      elif len(proximo)==2:
          repes=repes.append(proximo)
          return len(proximo)
  resultado=pd.Series([rarea(robser.iloc[cnt]) for cnt in range (0,len(robser))])`
  </code></pre>
  
  <p>I get the following error "local variable 'repes' referenced before assignment".</p>
  
  <p>How can I initialize the repes dataframe in the beginning?. Why isn't it enough to use repes=pd.DataFrame()? Ehay am I missing?</p>
  
  <p>Thank you </p>