Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pivot_table indexing

table = pd.pivot_table(df, values='D', index=['A', 'B'],
...                     columns=['C'], aggfunc=np.sum, fill_value=0)
>>> table
C        large  small
A   B
bar one      4      5
    two      7      6
foo one      4      1
    two      0      6
Source by pandas.pydata.org #
 
PREVIOUS NEXT
Tagged: #indexing
ADD COMMENT
Topic
Name
7+2 =