atleast_2d

metpy.units.atleast_2d(*arrs)[source]

Convert inputs to arrays with at least two dimensions.

Scalars and 1-dimensional arrays are converted to 2-dimensional arrays, whilst other higher-dimensional inputs are preserved. This is a thin wrapper around numpy.atleast_2d to preserve units.

Parameters

arrs (arbitrary positional arguments) – Input arrays to be converted if necessary

Returns

pint.Quantity – A single quantity or a list of quantities, matching the number of inputs.