Pivot table of Pandas

Sayth Renshaw flebber.crue at gmail.com
Thu Apr 28 21:59:21 EDT 2016


On Friday, 29 April 2016 09:56:13 UTC+10, David Shi  wrote:
> Hello, Matt,
> Please see the web link.Pandas Pivot Table Explained
> 
> |   |
> |   |   |   |   |   |
> | Pandas Pivot Table ExplainedExplanation of pandas pivot_table function. |
> |  |
> | View on pbpython.com | Preview by Yahoo |
> |  |
> |   |
> 
> 
> Debra and Fred have their own groups.
> How to split the pivot table into separate tables?
> What types of objects are these pivot tables?
> How to access the "manager" column?
> the pivot table is interesting to users, but it is very different from databases which we normally know.
> Looking forward to hearing from you.
> Regards.
> David

Unsure of your exact requirements but this doc on reshaping seems to cover the requirements posted. You would not get 2 tables that would be counter-intuitive to a pivottable.

You would just define a group in rows and the columns as the data or vice versa.

So 
Debra             data of some sort
  team_member1     44
  team_member2     56
Fred
  team_memeber1    62
  team_memeber2    33

http://pandas.pydata.org/pandas-docs/stable/reshaping.html

Sayth



More information about the Python-list mailing list