input: Write a function to parse a CSV file and generate a new CSV file that includes the total number of rows, total number of columns, and the total amount of data for each attribute. The function should return nothing but should write the new CSV file with the specified details.
  
  def parse_csv(filename):
      with open(filename) as csv_file:
          reader = csv.DictReader(csv_file)
          rows = 0
          cols = 0
          data_totals = []
          for row in reader:
              rows += 1
              cols = len(row)
              for col in row:
                  col_index = list(row.keys()).index(col)
                  if len(data_totals) <= col_index:
                      data_totals.append([float(row[col]), 1])
                  else:
                      data_totals[col_index][0] += float(row[col])
                      data_totals[col_index][1] += 1
          # Write to new csv
          with open('new_csv.csv', mode='w', newline='') as new_csv_file:
              writer = csv.writer(new_csv_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
              writer.writerow(['Rows', 'Columns', 'Data Totals'])
              data_totals_str = [str(total[0]) + ' (' + str(total[1]) + ' records)' for total in data_totals]
              writer.writerow([rows, cols, ', '.join(data_totals_str)])
  
  if __name__ == '__main__':
      filename = 'test.csv'
      parse_csv(filename)
  
  assert parse_csv('test.csv') == None
  # Expected output: A new CSV file 'new_csv.csv' with details: Rows: X, Columns: Y, Data Totals: Z for each attribute.
output: def parse_csv(filename):
      with open(filename) as csv_file:
          reader = csv.DictReader(csv_file)
          rows = 0
          cols = 0
          data_totals = []
          for row in reader:
              rows += 1
              cols = len(row)
              for col in row:
                  col_index = list(row.keys()).index(col)
                  if len(data_totals) <= col_index:
                      data_totals.append([float(row[col]), 1])
                  else:
                      data_totals[col_index][0] += float(row[col])
                      data_totals[col_index][1] += 1
          # Write to new csv
          with open('new_csv.csv', mode='w', newline='') as new_csv_file:
              writer = csv.writer(new_csv_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
              writer.writerow(['Rows', 'Columns', 'Data Totals'])
              data_totals_str = [str(total[0]) + ' (' + str(total[1]) + ' records)' for total in data_totals]
              writer.writerow([rows, cols, ', '.join(data_totals_str)])