Transform a rectangular input into a NumPy float64 array using flattening, transposition, or a leading batch dimension.