4 ms·
Pandas pivot table explained
- petulla 12y agoWhat are the advantages over groupby?
- chris1610 12y agoI think it ultimately is just a simpler wrapper around groupby once you start trying to do multiple levels of analysis.
- mrits 12y agoit seems like "columns" would be analogous to multiple "sum(CASE WHEN 'val' ELSE 0) as col" SQL idioms.
- rrrrtttt 12y agoIt takes the groups and arranges them as the columns of a table. Whereas groupby allows you to operate on this table in the vertical direction, the full pivot table allows you to also operate on it horizontally.