input: from typing import List, Union
  
  def parse_csv(filename: str) -> Union[int, int, List[List[float]]]:
      """ 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.
      
      >>> parse_csv('test.csv')
      [3, 4, [[15.0, 3], [8.0, 3], [21.0, 3], [10.0, 3]]]
      """
      import csv
  
      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)
                  data_totals = [[float(row[col]), 1] for col in row]
              else:
                  for index, col in enumerate(row):
                      data_totals[index][0] += float(row[col])
                      data_totals[index][1] += 1
  
      #write to new csv
      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])
  
      return [rows, cols, data_totals]
output:     import csv
  
      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)
                  data_totals = [[float(row[col]), 1] for col in row]
              else:
                  for index, col in enumerate(row):
                      data_totals[index][0] += float(row[col])
                      data_totals[index][1] += 1
  
      #write to new csv
      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])
  
      return [rows, cols, data_totals]