title: SQL "partition by" similar feature in Python/R
body: <p>Is there any packages either in R (data.table/dplyr) or in Python, that can do SQL code below in some consistent and straightforward way?</p>
  
  <p>Can you share some examples of doing it?</p>
  
  <p>Example of what I need:</p>
  
  <p><strong>My input data-frame (CSV, sep - ";", headers - True) :</strong></p>
  
  <pre><code>articule;group;is_new;ammount
  1;fruits;1;100
  2;fruits;1;200
  3;fruits;1;300
  4;fruits;0;400
  5;frozen;0;500
  6;frozen;0;600
  7;frozen;0;700
  8;frozen;1;800
  </code></pre>
  
  <p><strong>My expected output (CSV, sep - ";", headers - True):</strong></p>
  
  <pre><code>articule;group;is_new;ammount;sum_by_group;sum_by_group_is_new;result
  1;fruits;1;100;1000;600;0.60
  2;fruits;1;200;1000;600;0.60
  3;fruits;1;300;1000;600;0.60
  4;fruits;0;400;1000;400;0.40
  5;frozen;0;500;2600;1800;0.69
  6;frozen;0;600;2600;1800;0.69
  7;frozen;0;700;2600;1800;0.69
  8;frozen;1;800;2600;800;0.31
  </code></pre>
  
  <p><strong>My code in SQL:</strong> </p>
  
  <pre><code>select a.*, sum_by_group_is_new / sum_by_group result from (
  
  select a.*, 
  sum(ammount) over (partition by group) sum_by_group,
  sum(ammount) over(partition by group, is_new) sum_by_group_is_new 
  from input_data_frame a
  
  ) a;
  </code></pre>
  
  <p>Best regards</p>