bug-datamash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-datamash] Crosstab support for multiple groups


From: Daniel Pettersson
Subject: [Bug-datamash] Crosstab support for multiple groups
Date: Tue, 25 Sep 2018 13:01:38 -0000

Hi,

Thank you for this splendid tool!

I have a use case where I would like to be able to crosstab on more
than two groups/columns, just like groupby works. Something like this

    crosstab X1,X2,... Y [op fld ...]

I have data in the  "tidy long" format and would like to transform and
aggregate into "wide" format.
Something along the lines of the pivot_table function in the Python
library pandas 
(http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.pivot_table.html)

    df.pivot_table(index=['Index', 'date'], columns='variable',
values='value', aggfunc=np.sum)


Would this be something you could work on, or point me into a
direction for how to implement this?

Thanks!

-- 
profil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]