code: def calculate_disc_entropy(X):
      r
      X = asarray2d(X)
      n_samples, _ = X.shape
      _, counts = np.unique(X, axis=0, return_counts=True)
      empirical_p = counts * 1.0 / n_samples
      log_p = np.log(empirical_p)
      entropy = -np.sum(np.multiply(empirical_p, log_p))
      return entropy
docs: r"""Calculates the exact Shannon entropy of a discrete dataset,
      using empirical probabilities according to the equation:
      $ H(X) = -\sum(c \in X) p(c) \times \log(p(c)) $
      Where $ p(c) $ is calculated as the frequency of c in X.
  
      If X's columns logically represent continuous features,
      it is better to use the estimate_cont_entropy function.
      If you are unsure of which to use, estimate_entropy can
      take datasets of mixed discrete and continuous functions.
  
      Args:
          X (array-like): An array-like (np arr, pandas df, etc.) with shape
              (n_samples, n_features) or (n_samples)
  
      Returns:
          float: A floating-point number representing the dataset entropy.