input: from typing import List
  
  def transpose(A: List[List[float]]) -> List[List[float]]:
      """ 
      Optimizes a Python program that processes a 2D array (A) and stores the transpose
      output in a new array (B).
  
      >>> transpose([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
      [[1.0, 4.0], [2.0, 5.0], [3.0, 6.0]]
      >>> transpose([[7.0, 8.0], [9.0, 10.0]])
      [[7.0, 9.0], [8.0, 10.0]]
      """
output:     rows = len(A)
      cols = len(A[0])
      B = [[0.0 for _ in range(rows)] for _ in range(cols)]
      for i in range(rows):
          for j in range(cols):
              B[j][i] = A[i][j]
      return B