>>> import pandas as pd >>> df = pd.read_csv('samarretes.csv', parse_dates=['Data']) --ini-enunciat >>> from talles import vendes_per_talla >>> d = vendes_per_talla(df, '*') >>> if d != {'L': 2829, 'M': 2655, 'S': 931, 'XL': 2521, 'XS': 360, 'XXL': 911}: ... print(f"El valor retornat no és l'esperat: {d}") >>> d = vendes_per_talla(df, 'home') >>> if d!= {'L': 1785, 'M': 1500, 'S': 326, 'XL': 1836, 'XS': 128, 'XXL': 664}: ... print(f"El valor retornat no és l'esperat: {d}") >>> d = vendes_per_talla(df, 'dona') >>> if d!= {'L': 1044, 'M': 1155, 'S': 605, 'XL': 685, 'XS': 232, 'XXL': 247}: ... print(f"El valor retornat no és l'esperat: {d}") --fi-enunciat >>> d = vendes_per_talla(df.iloc[:100], '*') >>> if d != {'L': 278, 'M': 309, 'S': 107, 'XL': 169, 'XS': 40, 'XXL': 127}: ... print(f"El valor retornat no és l'esperat: {d}") >>> d = vendes_per_talla(df.iloc[100:500], 'home') >>> if d != {'L': 697, 'M': 745, 'S': 124, 'XL': 1001, 'XS': 44, 'XXL': 267}: ... print(f"El valor retornat no és l'esperat: {d}") >>> d = vendes_per_talla(df.iloc[700:], 'dona') >>> if d != {'L': 241, 'M': 330, 'S': 172, 'XL': 161, 'XS': 58, 'XXL': 54}: ... print(f"El valor retornat no és l'esperat: {d}")