Re: Untitled

From Chartreuse Parakeet, 3 Months ago, written in Plain Text, viewed 60 times. This paste is a reply to Untitled from Perl Treeshrew - view diff
URL http://codebin.org/view/3bfd0f17 Embed
Download Paste or View Raw
  1. calls_number = (calls.query('duration > 0')
  2.                              .groupby(['user_id', 'month'])
  3.                              .agg({'id':'count'}))
  4.  
  5.  
  6. #второй вариант
  7. calls_number = (calls.query('duration > 0')
  8.                      .pivot_table(index = 'user_id',
  9.                                   columns = 'month',
  10.                                   values = 'id',
  11.                                   aggfunc = 'count'))

Reply to "Re: Untitled"

Here you can reply to the paste above