- calls_number = (calls.query('duration > 0')
- .groupby(['user_id', 'month'])
- .agg({'id':'count'}))
- #второй вариант
- calls_number = (calls.query('duration > 0')
- .pivot_table(index = 'user_id',
- columns = 'month',
- values = 'id',
- aggfunc = 'count'))
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
— Expand Paste to full width of browser