<p>我的pandas DataFrame包含以下列:</p>
<blockquote>
<ol>
<li><strong>VisitorID</strong> (unique for each user - cookie based) </li>
<li><strong>VisitNumber</strong> (1 = first visit, 2 = second visit and etc...) </li>
<li><strong>TimeSpentOnVist</strong> (visit duration in seconds)</li>
<li><strong>Channel</strong> (the referrer of the visit. ex: Facebook, Google and Bing )</li>
<li><strong>Media type</strong> (paid or organic)</li>
</ol>
</blockquote>
<p>每次访问(1、2、3)都会重复访客ID。我想把上次访问的时间汇总到频道和媒体类型,但同时,汇总(总结)所有访问所花费的时间。我的目标是按visitorID分组,这样就不会有重复。在</p>
<p>在大熊猫体内进行这种聚集最有效的方法是什么?在</p>