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

Is duckdb a suitable alternative to polars? #58

Open
afermg opened this issue Dec 13, 2024 · 1 comment
Open

Is duckdb a suitable alternative to polars? #58

afermg opened this issue Dec 13, 2024 · 1 comment
Assignees

Comments

@afermg
Copy link
Collaborator

afermg commented Dec 13, 2024

The use-case is trommel. The only polars functionality it needs is column selection (pl.select), for which we use dtypes.

In theory we can replace it with duckdv's select_dtypes (or other selection methods). It may be slightly faster, but the important thing is that we shed a lot of dependencies and the methodology may become a portable way to deal with the 'remove metadata -> process data -> append metadata' workflow.

@afermg
Copy link
Collaborator Author

afermg commented Dec 17, 2024

Implementation note: Converting a duckdb object to numpy is ~20% faster using numpy.array(list(X.fetchnumpy().values())) compared to X.pl().to_numpy().
Surprisingly there is no direct way to go from a duckdb table to a numpy array straight away, only to dictionaries of numpy arrays (per column of course).

@afermg afermg self-assigned this Dec 17, 2024
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

1 participant