Gmousse / dataframe-js

No Maintenance Intended
https://gmousse.gitbooks.io/dataframe-js/
MIT License
459 stars 39 forks source link

[QUESTION] Pivoting a table #115

Open am2222 opened 3 years ago

am2222 commented 3 years ago

Ask your question Hello, Supposed we have a following table

place|time|key|value A | t1 |test| 01 A | t2 |test| 02 A | t3 |test| 03 B | t1 |test| 04 C | t2 |test| 05 D | t3 |test| 06 A | t1 |test1| 07 A | t2 |test1| 08 A | t3 |test1| 08 B | t1 |test1| 09 C | t2 |test1| 10 D | t3 |test1| 11

Is there any way to pivot this structure into this form? place|time|test1|test2 A | t1 | 01|07 A | t2 | 02|08 A | t3 | 03|08 B | t1 | 04|09 C | t2 | 05|10 D | t3 | 06|11 Additional context I know I can do some joins with having another key but I am wondering if there is any dataframe-js method to do it which has a good performance as well. Thanks

am2222 commented 3 years ago

Maybe this method? https://github.com/Gmousse/dataframe-js/issues/99