Python Forum

Full Version: How to split monthly data smoothly into days?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
have statistical reports, that are presented monthly. I would like to present the same data daily (keeping the total amount for the month). Of course, I can break the total values by the number of days in a month, but then a "step" is formed at the border of the months, which I want to avoid.

I have:

01.01.2000 1000
01.02.2000 800
01.03.2000 1290

I need (daily data is approximate):

01.01.2000 34.3
02.01.2000 32.8
...
31.01.2000 28.2
01.02.2000 28.4
02.02.2000 28.7
.....
29.02.2000 32.6
01.03.2000 32.7
.....
31.03.2000 45.1

How can I do this?
you can first split each line using space as delimiter into a new list, then split the first word of list using '.' as delimiter.
now you can accumulate totals on first element of the list.