79615704

Date: 2025-05-10 16:46:05
Score: 1
Natty:
Report link

You can try groupby() along with sum() to group the data by the 'date' column and calculate the total sales per day.


result = df.groupby('date')['sales'].sum().reset_index()

If you'd like to keep date as the index, you can remove .reset_index().

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Yuvraj Korotana