input: Write a function to compute the moving average of time-series data points. The function should take a list of data points and an integer window size as input, and return a list of moving averages. The moving average at each point should be the average of the current and the previous (window-1) data points. If the number of previous data points is less than window-1, compute the average of the available data points. If the input 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]
  assert moving_average(time_series, window) == [3.0, 4.0, 5.0, 4.666666666666667, 5.666666666666667, 6.666666666666667, 9.666666666666666, 28.666666666666668, 49.333333333333336, 72.66666666666667, 84.0, 93.33333333333333, 113.33333333333333]
  assert moving_average([], window) == []
output: 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