Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rolling Sum by Facility
#1
I'm looking to create a rolling 12 average for a dataset. The data set has columns for MONTH, Facility, Patient Days.

I want to create a rolling 12 for Patient days but group by Facility.

So for example, Facility X has monthly data with patient days, I want to calculate the rolling for 12 months by Facility X but not Facility Y which needs its own rolling 12.

example of Dataset

MONTH Facility PatientDays
7/1/19 X 100
8/1/19 X 200
9/1/19 X 300
7/1/19 Y 200
8/1/19 Y 100
9/1/19 Y 500
Reply
#2
This looks like a pretty easy problem. Pandas is designed to do this kind of work. What have you got so far?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Command is not rolling over to the next keyword. brightlite11 3 2,799 Jan-30-2019, 07:44 AM
Last Post: buran
  Newbie question for a kind of rolling average of list of lits zydjohn 3 3,343 Dec-16-2017, 11:41 PM
Last Post: ezdev

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020