input: Write a function to optimize the given Python code by using list comprehensions for a more efficient data filtering process. The function should take a list of integers as input and return a list containing only those integers that are greater than 2. The function should be named `filter_data`.
  assert filter_data([1, 2, 3, 4])==[3, 4]
  assert filter_data([5, 6, 7, 8, 9])==[5, 6, 7, 8, 9]
  assert filter_data([1, 2])==[]
  assert filter_data([2, 2, 2, 2])==[]
  assert filter_data([-1, 0, 1])==[]
output: def filter_data(data):
      return [x for x in data if x > 2]