import pandas as pd def count_sum(df: pd.DataFrame) -> pd.DataFrame: return df.groupby('Товар')['Количество'].sum().reset_index().set_index('Товар')