title: Assign group averages to each row in python/pandas
body: <p>I have a dataframe and I am looking to calculate the mean based on store and all stores.  I created code to calculate the mean but I am looking for a way that is more efficient. </p>
  
  <p>DF</p>
  
  <pre><code>Cashier#     Store#     Sales    Refunds
  001          001        100      1
  002          001        150      2
  003          001        200      2
  004          002        400      1
  005          002        600      4
  </code></pre>
  
  <p>DF-Desired</p>
  
  <pre><code>Cashier#     Store#     Sales    Refunds     Sales_StoreAvg    Sales_All_Stores_Avg
  001          001        100      1            150               290
  002          001        150      2            150               290
  003          001        200      2            150               290
  004          002        400      1            500               290
  005          002        600      4            500               290
  </code></pre>
  
  <p>My Attempt
  I created two additional dataframes then did a left join</p>
  
  <pre><code>df.groupby(['Store#']).sum().reset_index().groupby('Sales').mean() 
  </code></pre>