'Combine xarray Dataset variables along a new dimension without expanding each one
I have an xarray with dimensions lat and lon. It includes 17 variables, each one corresponding with a different time step. I would like to expand the dimensions to include time and reduce the number of variables to only one, with 17 time steps. I've tried implementing this with the following code, but I end up with n variables, with each variable including all the time steps and lat, long dimensions.
all_dates = ['2019-03-29','2019-05-10','2019-06-21','2019-07-19','2019-08-30','2019-10-11','2019-11-22','2020-01-03','2020-02-14','2020-03-27','2020-05-08','2020-06-19','2020-07-17','2020-08-28','2020-10-09','2021-10-08','2021-11-19']
date_list = pd.to_datetime(all_dates)
ds2 = ds.expand_dims(time=date_list)
The new dataset includes an array of 17 timesteps for each data variable, instead of one data variable with 17 time steps: 
Is there a way to add a time dimension, and reduce the dataset's n variables to include a single variable corresponding with the n time steps in the time dimension?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

