I cannot comment the previous comment of @rukmini.
To get cost by resource :
for row in result.as_dict()['rows']:
resource_id = row[2]
resource = resource_id.split('/')[-1]
cost_sum = row[1]
print(f"Cost for [{time_period_in_past}] days for resource [{resource}] is [{cost_sum}] USD")