For irregular shapes in some cases using multiple groups + xarray.DataTree can help you, but in general yeah ragged data is hard.