title: Count instances of transactions per day pandas data frame
body: <p>I would like to retrieve a column from a csv file and make it an index in a dataframe. However, I realize that I might need to do another step beforehand.</p>
  
  <p>The csv looks like this;</p>
  
  <pre><code>Date,Step,Order,Price
      2011-01-10,Step,BUY,150
      2011-01-10,Step,SELL,150
      2011-01-13,Step,SELL,150
      2011-01-13,Step1,BUY,400
      2011-01-26,Step2,BUY,100
  </code></pre>
  
  <p>If I print the dataframe this is the output:</p>
  
  <pre><code>    Date Step Order  Price
  0      0   Step  BUY    150
  1      1   Step  SELL   150
  2      2   Step  SELL   150
  3      3   Step1 BUY    400
  4      4   Step2 BUY    100
  </code></pre>
  
  <p>However, the output that I would like is to tell how many buys/sells per type of Step I have on each day.</p>
  
  <p>For example;</p>
  
  <p>The expected dataframe and output are:</p>
  
  <pre><code>Date        Num-Buy-Sell                                               
  2011-01-10   2
  2011-01-13   2
  2011-01-16   1
  </code></pre>
  
  <p>This is the code on how I'm retrieving the data frame;</p>
  
  <pre><code>num_trasanctions_day = pd.read_csv(orders_file, parse_dates=True, sep=',', dayfirst=True)
  num_trasanctions_day['Transactions'] = orders.groupby(['Date', 'Order'])
  num_trasanctions_day['Date'] = num_trasanctions_day.index
  </code></pre>
  
  <p>My first thought was to make date the index, but I guess I need to calculate how many sell/buys are there per date.</p>
  
  <p><strong>Error</strong></p>
  
  <pre><code>KeyError: 'Order'
  </code></pre>
  
  <p>Thanks</p>