From c3a2799341bc8e5e112f7a72c72cd3a21bc60f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A8=D0=B8=D0=BC=D1=87=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Thu, 3 Jul 2025 11:47:38 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20count=5Fsum=5Fpandas.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- count_sum_pandas.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/count_sum_pandas.py b/count_sum_pandas.py index 09da9a6..9fca5a3 100644 --- a/count_sum_pandas.py +++ b/count_sum_pandas.py @@ -1,4 +1,4 @@ -import pandas as pd - -def count_sum(df: pd.DataFrame) -> pd.DataFrame: - return df.groupby('Товар')['Количество'].sum().reset_index() \ No newline at end of file +import pandas as pd + +def count_sum(df: pd.DataFrame) -> pd.DataFrame: + return df.groupby('Товар')['Количество'].sum().reset_index().set_index('Товар') \ No newline at end of file