Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pivot capability #15

Closed
Antwnis opened this issue Jan 27, 2016 · 4 comments
Closed

Pivot capability #15

Antwnis opened this issue Jan 27, 2016 · 4 comments

Comments

@Antwnis
Copy link

Antwnis commented Jan 27, 2016

Imagine you have a schema : quarter - product - sales with data

("quarter1",  "wine",   100)
("quarter1",  "beer",   220)
("quarter1",  "coffee", 550)
("quarter2",  "coffee", 5)

And you want to pivot by product and sales - with newschema = "wine" , "beer" , "coffee" defaultvalue=0 resulting into data

quarter      wine     beer   coffee
quarter1      100     220      0
quarter2        0       0      5

Also be able to unpivot the data

@sksamuel
Copy link
Contributor

I've never really understood pivot tables. It seems you're replacing the
column names with values of a different column, so in this case the type of
drinks are the new column headers. Is it sufficient to just say
frame.pivot(columnName), or do you need to specify two, and if two, why.

On 27 January 2016 at 11:11, Antonios Chalkiopoulos <
notifications@github.com> wrote:

Imagine you have a schema : quarter - product - sales with data

("quarter1", "wine", 100)
("quarter1", "beer", 220)
("quarter1", "coffee", 550)
("quarter2", "coffee", 5)

And you want to pivot by product and sales - with newschema = "wine"
, "beer" , "coffee" defaultvalue=0 resulting into data

quarter wine beer coffee
quarter1 100 220 0
quarter2 0 0 5

Also be able to unpivot the data


Reply to this email directly or view it on GitHub
#15.

@Antwnis
Copy link
Author

Antwnis commented Jan 27, 2016

I think this gives some basics analytics capabilities into the lib
One column should be ok

@garyfrost
Copy link
Member

@sksamuel
Copy link
Contributor

This might have to live in an algo module as pivot requires all (?) / some (?) data in memory at once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants