id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type 1930702782,I_kwDOAMm_X85zFC--,8278,A way to `stack` all dimensions but one?,92899389,closed,0,,,3,2023-10-06T17:48:18Z,2023-10-06T20:58:20Z,2023-10-06T20:58:20Z,NONE,,,,"### Is your feature request related to a problem? One thing I find useful with `DataArrays` is the ability to take all dimensions but one, `stack` them into one `MultiIndex`, and then iterate over the entries of that `MultiIndex`. For example, I have a `DataArray` that starts with a `time` dimension/coordinate. I then add several new dimensions/coords that correspond to varying input parameters (i.e. one for initial velocity, initial position, air density, etc.). What I then want to do is iterate over all 1D `time` vectors (all the combinations of those variable input parameters). The easiest way I've found to do this is to `stack` all the dimensions except `time` and then iterate over the resulting `MultiIndex`. I have been doing this by converting the `dims` of the `DataArray` to a `list` and then removing `""time""` from that list and using it as the input to `stack`. ### Describe the solution you'd like It would be awesome if there was a method that could specifically stack all dimensions except for a list of specified dimension names (something like `DataArray.stack_except({""name_of_created_stacked_dimension"": [""dim_to_leave_unstacked"", ""another_dim""])`), or some kind of syntax that would allow an ""all except"" behavior to be passed directly into `stack` (could be something like `DataArray.stack({""name_of_created_stacked_dimension""}: [""dim_to_leave_unstacked""], invert=True). ### Describe alternatives you've considered If there is a better way to achieve what I'm trying to accomplish (take one dimension and iterate over all the combinations of the other dimensions, resulting in 1D vectors that vary along the single desired dimension), then I would welcome any tips! ### Additional context _No response_","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/8278/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue