Add unique daily stat uploads lineplot
This commit is contained in:
parent
efa08b4b54
commit
499a819c90
1 changed files with 27 additions and 0 deletions
27
popcorn.py
27
popcorn.py
|
|
@ -202,10 +202,37 @@ def _(df_lazy: pl.LazyFrame):
|
|||
caption="Downloads aggregated per month of the year.",
|
||||
)
|
||||
)
|
||||
|
||||
_()
|
||||
return
|
||||
|
||||
|
||||
@app.cell
|
||||
def _():
|
||||
df_unique_downloads = (
|
||||
pl.scan_ndjson("data/daily/*", include_file_paths="file")
|
||||
.head(LIMIT_ROWS) # FIXME: take out after debug
|
||||
.with_columns(
|
||||
pl.col("file")
|
||||
.str.replace(r"data/daily/(\d{4}-\d{2}-\d{2}).json", "${1}")
|
||||
.str.to_date()
|
||||
.alias("date")
|
||||
)
|
||||
.select(["date", "UniqueInstalls"])
|
||||
.collect()
|
||||
)
|
||||
(
|
||||
lp.ggplot(df_unique_downloads, lp.aes("date", "UniqueInstalls"))
|
||||
+ lp.geom_line()
|
||||
+ lp.geom_smooth()
|
||||
+ lp.labs(
|
||||
title="Unique daily uploads",
|
||||
caption="Daily number of unique providers for package update statistics opting in to popcorn.",
|
||||
)
|
||||
)
|
||||
return
|
||||
|
||||
|
||||
@app.cell
|
||||
def _():
|
||||
mo.md(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue