input: Write a function to compute the moving average of time-series data points over a specified window size. If the given list of data points is empty, return an empty list.
  def moving_average(data_points, window):
      moving_average = []
      for index in range(len(data_points)):
          start = 0 if index-window+1 < 0 else index-window+1
          window_data = data_points[start:index+1]
          average = sum(window_data)/len(window_data)
          moving_average.append(average)
  
      return moving_average
  
  window = 3
  time_series = [3, 5, 7, 2, 8, 10, 11, 65, 72, 81, 99, 100, 150]
  moving_average = moving_average(time_series, window)
  assert moving_average == [3, 4.0, 5.0, 4.5, 5.2, 6.0, 7.0, 38.5, 44.333333333333336, 53.0, 63.333333333333336, 76.66666666666667, 113.33333333333333]
  empty_series = []
  assert moving_average(empty_series, window) == []
output: def moving_average(data_points, window):
      if not data_points:
          return []
      moving_average = []
      for index in range(len(data_points)):
          start = max(0, index - window + 1)
          window_data = data_points[start:index + 1]
          average = sum(window_data) / len(window_data)
          moving_average.append(average)
      return moving_average