pola-rs / nodejs-polars

nodejs front-end of polars

Home Page:https://pola-rs.github.io/nodejs-polars/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pivot function documentation error

BorisTherin opened this issue · comments

hi awesome team.

i had troubles with pivot function documentation with nodejs-polars in my juspyterlab deno kernel

pivot doc

here the example is something wrong:
image

here my code to make pivot works:

const df = pl.DataFrame(
     {
         "foo": ["one", "one", "one", "two", "two", "two"],
         "bar": ["A", "B", "C", "A", "B", "C"],
         "baz": [1, 2, 3, 4, 5, 6],
     }
 );

const pivot = df.pivot(pl.col("baz"), {values:"baz", index:["foo"], columns:["bar"]});

Hopefully the pivot(values, options) documentation drived me to the solution when the example was wrong with df.pivot({values:"baz", index:"foo", columns:"bar"}); where values is missing as 1st argument

sry for the bug label, started with github last year & not really used to provide issues in such great repository, sounds like the documentation tag shall fit better, but sounds like i cant no more change it

@BorisTherin This is was resolved in #181 Thanks for binging this up.