From 014d1eaaae1e1cfaddc48f72dbfd20a351544d52 Mon Sep 17 00:00:00 2001 From: Andrew Jackson Date: Wed, 25 Oct 2023 14:12:50 +0100 Subject: [PATCH] Add by-stream breakdown. --- content/storage/summary.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/content/storage/summary.md b/content/storage/summary.md index 559eabc..fbae225 100644 --- a/content/storage/summary.md +++ b/content/storage/summary.md @@ -206,6 +206,29 @@ tots['timestamp_dt'] = tots['timestamp_dt'].dt.year.apply(lambda x: str(x)) show_table_and_dl(tots, 'totals_by_year_collection') ``` ++++ {"editable": true, "slideshow": {"slide_type": ""}} + +### Totals by Year & Stream + +```{code-cell} ipython3 +--- +editable: true +slideshow: + slide_type: '' +tags: [remove-input] +--- +tots = dfu.groupby([pd.Grouper(key='timestamp_dt', freq="A"), 'stream_s']).agg(count=('file_size_l', 'count'), size=('file_size_l', 'sum')) +tots = tots.reset_index() + +# Clip year: +tots['timestamp_dt'] = tots['timestamp_dt'].dt.year.apply(lambda x: str(x)) + +# Show table and downloader: +show_table_and_dl(tots, 'totals_by_year_stream') +``` + ++++ {"editable": true, "slideshow": {"slide_type": ""}} + ### Totals by Year, Collection, Stream, Store & Kind ```{code-cell} ipython3