title: Pandas equivalent to SQL window functions
body: <p>Is there an idiomatic equivalent to SQL's window functions in Pandas? For example, what's the most compact way to write the equivalent of this in Pandas?:</p>
  
  <pre><code>SELECT state_name,  
         state_population,
         SUM(state_population)
          OVER() AS national_population
  FROM population   
  ORDER BY state_name 
  </code></pre>
  
  <p>Or this?:</p>
  
  <pre><code>SELECT state_name,  
         state_population,
         region,
         SUM(state_population)
          OVER(PARTITION BY region) AS regional_population
  FROM population    
  ORDER BY state_name
  </code></pre>