Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,17 @@ import duckdb
import hvplot.duckdb
from bokeh.sampledata.autompg import autompg_clean as df

df_duckdb = duckdb.from_df(df)
table = df_duckdb.groupby(['origin', 'mfr'])['mpg'].mean().sort_values().tail(5)
con = duckdb.connect(':memory:')
con.register('autompg', df)

query = """
SELECT origin, mfr, AVG(mpg) as mpg
FROM autompg
GROUP BY origin, mfr
ORDER BY mpg DESC
LIMIT 5
"""
table = con.query(query).sort("mpg")
table.hvplot.barh('mfr', 'mpg', by='origin', stacked=True)
```
```{image} ./_static/home/pandas.gif
Expand Down