Python Rolling Average Function In Sql