title: Problem calculating average for values in multiple rows with a common id, not a column or through slicing
body: <p>I have a dataframe which contains orders from a restaurant, order ids and prices of each item from the order. One row is a name of the product with its price and order id. I would like to calculate the average of all <strong>orders</strong>, but hence the order may consist of multiple products they are in separate rows.</p>
  <p>I was trying to define what an order is in python but since I'm a newbie, with no success.</p>
  <pre><code>for order in df:
    n = 1
    order = df.order_id == n
    for order in orders:
      orders.median()
      n = n + 1
  </code></pre>
  <p>This is what the table looks like - as you can see the order id for the forst two items is the same:</p>
  <pre><code>order_id    quantity    item_name   choice_description                  item_price
  0           1           1           Chips and Fresh Tomato Salsa    NaN 2.39
  1           1           1           Izze    [Clementine]                3.39
  </code></pre>
  <p>I have  a problem with the syntax, I don't know how to express it in python language. Could you please help?</p>
  <p>Thanks a lot!</p>