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

concat with diagonal option #124

Closed
jospueyo opened this issue Sep 29, 2023 · 0 comments · Fixed by #125
Closed

concat with diagonal option #124

jospueyo opened this issue Sep 29, 2023 · 0 comments · Fixed by #125

Comments

@jospueyo
Copy link

The python implementation of polars allows an option how = "diagonal" in the pl.concat() when DataFrames don't have the same columns. I tried with nodejs-polars but it seems that this is not implemented:

const pl = require('nodejs-polars')

let df1 = pl.DataFrame(
    {
      id: [1, 2, 3, 4, 5],
      fruits: ["banana", "banana", "apple", "apple", "cherry"],
      cars: ["beetle", "audi", "beetle", "beetle", "vw"],
    }
);

let df2 = pl.DataFrame(
    {
        id: [6, 7, 8, 9],
        fruits: ["pear", "peach", "pineapple", "apple"],
        names: ["John", "Jane", "Joe", "Jack"]
    }
)

console.log(pl.concat([df1, df2]), {how: "diagonal"})

//> Error: lengths don't match: unable to vstack, column names don't match: "cars" and "names"

Thank you for this amazing library.

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

Successfully merging a pull request may close this issue.

1 participant