[Python] How to group data by date and calculate the sum in pandas? [duplicate]

Discussão em 'Python' iniciado por Stack, Maio 10, 2025.

  1. Stack

    Stack Membro Participativo

    I have a DataFrame with sales data that includes a 'date' and a 'sales' column. I want to group the data by date and calculate the total sales per day.

    df = pd.DataFrame({
    'date': ['2024-01-01', '2024-01-01', '2024-01-02'],
    'sales': [100, 150, 200]
    })

    Continue reading...

Compartilhe esta Página