title: intersection of two columns of pandas dataframe
body: <p>I have 2 pandas dataframes: <code>dataframe1</code> and <code>dataframe2</code> that look like this:</p>
  
  <pre><code>mydataframe1
  Out[15]: 
      Start   End  
      100     200
      300     450
      500     700
  
  
  mydataframe2
  Out[16]:
    Start   End       Value     
    0       400       0  
    401     499       -1  
    500     1000      1  
    1001    1698      1  
  </code></pre>
  
  <p>Each row correspond to a segment (start-end).
  For each segment in dataframe1 I would like to assign a value depending on the values assigned to the segments in dataframe2.</p>
  
  <p>For example: </p>
  
  <p>the first segment in dataframe1 <code>100 200</code> is included in the first segment of dataframe2 <code>0 400</code> then I should assign the value 0</p>
  
  <p>the second segment in dataframe1 <code>300 450</code> is contained in the first <code>0 400</code> and second <code>401 499</code> segments of dataframe2. In this case I need to split this segments in 2 and assign the 2 corresponding values. ie <code>300 400 -&gt; value 0</code> and <code>401 - 450 value -&gt;-1</code></p>
  
  <p>the final dataframe1 should look like</p>
  
  <pre><code>mydataframe1
  Out[15]: 
      Start   End  Value
      100     200  0
      300     400  0
      401     450  -1
      500     700  1
  </code></pre>
  
  <p>I hope I was claer..can you help me?</p>