Section 1. Chapitre 12
single
Challenge: Generate Weekly Summary Table
Glissez pour afficher le menu
Tâche
Glissez pour commencer à coder
Write a function that takes a list of sales records, each with a sales amount and a timestamp, and summarizes total sales by week.
- Convert the
timestampvalues to pandas datetime objects. - Create a new column that identifies the week for each record.
- Group the records by week and sum the
salesfor each group. - Return a DataFrame with the weekly totals.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 1. Chapitre 12
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion