input: Write a function to parse a CSV and generate a new CSV that adds the total number of rows, total number of columns, and total amount of data for each attribute. The function should take a filename as input and output a new CSV file named 'new_csv.csv'.
  
  assert parse_csv('test.csv')
  # Expected output: A new CSV file named 'new_csv.csv' containing the total number of rows, total number of columns, and total amount of data for each attribute.
output: def parse_csv(filename):
      import csv
      with open(filename, 'r') as file:
          reader = csv.reader(file)
          data = list(reader)
      
      num_rows = len(data)
      num_cols = len(data[0]) if num_rows > 0 else 0
      
      total_data = [0] * num_cols
      for row in data:
          for i in range(num_cols):
              total_data[i] += len(row[i]) if i < len(row) else 0
      
      with open('new_csv.csv', 'w', newline='') as new_file:
          writer = csv.writer(new_file)
          writer.writerow(['Total Rows', 'Total Columns'] + [f'Total Data for Column {i+1}' for i in range(num_cols)])
          writer.writerow([num_rows, num_cols] + total_data)