Skip to content

DuckDB Example #14

Description

@s2t2

We hear a lot about duck db these days, and people say it is fast. Let's provide some examples of using duck db.

https://duckdb.org/2021/05/14/sql-on-pandas

TL;DR: DuckDB, a free and open source analytical data management system, can efficiently run SQL queries directly on Pandas DataFrames.

AI generated example:

import pandas as pd
import duckdb

df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})

# Connect to DuckDB and run an SQL query directly on the DataFrame
duckdb_result = duckdb.query("SELECT A, AVG(B) as avg_b FROM df WHERE A > 1 GROUP BY A").to_df()

print(duckdb_result)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions