pola-rs / nodejs-polars

nodejs front-end of polars
https://pola-rs.github.io/nodejs-polars/
MIT License
434 stars 43 forks source link

pivot function documentation error #183

Closed BorisTherin closed 8 months ago

BorisTherin commented 8 months ago

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

BorisTherin commented 8 months ago

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

Bidek56 commented 8 months ago

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