input: 
  import csv
  
  def add_totals_to_csv(filename: str) -> None:
      """ Parses a CSV and generates a new CSV that adds the total number of rows, 
      total number of columns, and total amount of data for each attribute.
      >>> add_totals_to_csv('test.csv')
      # Generates a CSV with the following data:
      Rows,Columns,Data Totals
      5,4,[[10.0, 5], [20.0, 5], [30.0, 5], [40.0, 5]]
      """
      with open(filename) as csv_file:
          reader = csv.DictReader(csv_file)
          rows = 0
          cols = 0
          data_totals = []
          for row in reader:
              rows += 1
              if cols == 0:
                  cols = len(row)
              for col in row:
                  try:
                      col_val = float(row[col])
                      if len(data_totals) < cols:
                          data_totals.append([col_val, 1])
                      else:
                          data_totals[list(row.keys()).index(col)][0] += col_val
                          data_totals[list(row.keys()).index(col)][1] += 1
                  except ValueError:
                      pass  # Skip non-numeric values
          with open('new_csv.csv', mode='w') as new_csv_file:
              writer = csv.writer(new_csv_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
              writer.writerow(['Rows', 'Columns', 'Data Totals'])
              writer.writerow([rows, cols, data_totals])
  
  if __name__ == '__main__':
      filename = 'test.csv'
      add_totals_to_csv(filename)
  
output:     
      with open(filename) as csv_file:
          reader = csv.DictReader(csv_file)
          rows = 0
          cols = 0
          data_totals = []
          for row in reader:
              rows += 1
              if cols == 0:
                  cols = len(row)
              for col in row:
                  try:
                      col_val = float(row[col])
                      if len(data_totals) < cols:
                          data_totals.append([col_val, 1])
                      else:
                          data_totals[list(row.keys()).index(col)][0] += col_val
                          data_totals[list(row.keys()).index(col)][1] += 1
                  except ValueError:
                      pass  # Skip non-numeric values
          with open('new_csv.csv', mode='w') as new_csv_file:
              writer = csv.writer(new_csv_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
              writer.writerow(['Rows', 'Columns', 'Data Totals'])
              writer.writerow([rows, cols, data_totals])
  