input: Write a python function to calculate the entropy of a dataset.
  assert np.isclose(calculate_entropy([3, 3]), 1.0)
  assert np.isclose(calculate_entropy([4, 0]), 0.0)
  assert np.isclose(calculate_entropy([3, 2, 1]), 1.4591479)
output: import numpy as np
  
  def calculate_entropy(data):
      total = sum(data)
      if total == 0:
          return 0.0
      probabilities = [x / total for x in data]
      entropy = -sum(p * np.log2(p) for p in probabilities if p > 0)
      return entropy