code: def __init__(self, data, group_names, *args):
      self.groups = (
          args[0]
          if len(args) > 0 and args[0] is not None
          else [np.array([i]) for i in range(len(group_names))]
      )
  
      j = sum(len(g) for g in self.groups)
      num_samples = data.shape[0]
      t = False
      if j != data.shape[1]:
          t = True
          num_samples = data.shape[1]
  
      valid = (not t and j == data.shape[1]) or (
          t and j == data.shape[0]
      )
      if not valid:
          raise ValueError("# of names must match data matrix!")
  
      self.weights = args[1] if len(args) > 1 else np.ones(num_samples)
      self.weights /= np.sum(self.weights)
      wl = len(self.weights)
      valid = (not t and wl == data.shape[0]) or (
          t and wl == data.shape[1]
      )
      if not valid:
          raise ValueError("# of weights must match data matrix!")
  
      self.transposed = t
      self.group_names = group_names
      self.data = data
      self.groups_size = len(self.groups)
  
imports: import copy
  import numpy
  import pandas
  import scipy.sparse
  from sklearn.cluster import KMeans
  from sklearn.impute import SimpleImputer
label_desc: Use image node_id 1 to create a new DenseData object from inherited base classes: Data with example: obj = DenseData(data, group_names)