title: Group by Year and Month Panda Pivot Table
body: <p>I have data like this </p>
  
  <pre><code>    Date    LoanOfficer     User_Name       Loan_Number
  0   2017-11-30 00:00:00 Mark Evans      underwriterx    1100000293
  1   2017-11-30 00:00:00 Kimberly White  underwritery    1100004947
  2   2017-11-30 00:00:00 DClair Phillips underwriterz    1100007224
  </code></pre>
  
  <p>I've created df pivot table like this:</p>
  
  <pre><code>pd.pivot_table(df,index=["User_Name","LoanOfficer"],
                 values=["Loan_Number"],
                 aggfunc='count',fill_value=0,
                 columns=["Date"]
                        )
  </code></pre>
  
  <p>However I need the Date column to be grouped by Year and Month. I was looking at other solutions of resampling the dataframe and then applying the pivot but it only does it for Month and Days. Any help would be appreciated</p>