data = pd.read_csv("MLs_Unit_per_day.csv",index_col='Date')



            X1      X2  X3  X4  X5      X6
Date                        
01/01/2023  13  0   20  5   24  14
02/01/2023  13  0   20  5   24  15
03/01/2023  11  0   20  6   24  15
04/01/2023  12  0   20  6   22  16
05/01/2023  11  0   20  6   22  16
... ... ... ... ... ... ...
29/05/2023  13  1   23  6   22  17
30/05/2023  13  1   23  6   22  18
31/05/2023  13  1   23  7   23  18
01/06/2023  12  1   23  7   24  19
02/06/2023  13  0   23  8   24  19

I'm trying to group by month ans Sum X1, X2, etc for the hole month. how can I do?
thank you
I tried before without making Date as index with this
data.groupby(data['Date'].dt.strftime('%B'))['RO1'].sum().sort_values()

but it show me wrong time format and then wrong months

Group table by month
You need to convert the date to datetime, then create a new column for month and finally use groupby
data = pd.read_csv("MLs_Unit_per_day.csv")
data['Date'] = pd.to_datetime(data['Date'], format='%d/%m/%Y')

# Create a separate column for year and month
data['YearMonth'] = data['Date'].dt.to_period('M')

monthly_data = data.groupby('YearMonth').sum()

print(monthly_data)

