From c930eb739f58f656f494df9a2143740935a42160 Mon Sep 17 00:00:00 2001 From: sh00t2kill <38101689+sh00t2kill@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:02:44 +1100 Subject: [PATCH] Add Group by Appellation --- custom_components/cellar_tracker/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/cellar_tracker/__init__.py b/custom_components/cellar_tracker/__init__.py index 2be520e..cdf3e5c 100644 --- a/custom_components/cellar_tracker/__init__.py +++ b/custom_components/cellar_tracker/__init__.py @@ -90,7 +90,7 @@ def update(self, **kwargs): df = pd.DataFrame(list) df[["Price","Valuation"]] = df[["Price","Valuation"]].apply(pd.to_numeric) - groups = ['Varietal', 'Country', 'Vintage', 'Producer', 'Type', 'Location'] + groups = ['Varietal', 'Country', 'Vintage', 'Producer', 'Type', 'Location', 'Appellation'] for group in groups: group_data = df.groupby(group).agg({'iWine':'count','Valuation':['sum','mean']})