html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/2267#issuecomment-508925231,https://api.github.com/repos/pydata/xarray/issues/2267,508925231,MDEyOklzc3VlQ29tbWVudDUwODkyNTIzMQ==,2448579,2019-07-06T13:06:40Z,2019-07-06T13:06:40Z,MEMBER,This should be fixed by the latest `expand_dims`,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,338226520 https://github.com/pydata/xarray/issues/2267#issuecomment-406346802,https://api.github.com/repos/pydata/xarray/issues/2267,406346802,MDEyOklzc3VlQ29tbWVudDQwNjM0NjgwMg==,1217238,2018-07-19T17:02:07Z,2018-07-19T17:02:07Z,MEMBER,let's continue the repeated dimension discussion over in https://github.com/pydata/xarray/issues/1378,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,338226520 https://github.com/pydata/xarray/issues/2267#issuecomment-405950145,https://api.github.com/repos/pydata/xarray/issues/2267,405950145,MDEyOklzc3VlQ29tbWVudDQwNTk1MDE0NQ==,1200058,2018-07-18T14:26:58Z,2018-07-18T14:27:35Z,NONE,"Maybe related: Consider the following example to calculate pairwise distances: ``` x = np.array([[1,2,3,4]]) dist = x.T - x ``` numpy automatically broadcasts the one-dimensions to get 4x4 matrices and substracts them. As far as I can see, this example is really hard to recreate with xarray, since there is nearly no possibility to add a new dimension to `x` and broadcast it properly.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,338226520 https://github.com/pydata/xarray/issues/2267#issuecomment-402528430,https://api.github.com/repos/pydata/xarray/issues/2267,402528430,MDEyOklzc3VlQ29tbWVudDQwMjUyODQzMA==,1217238,2018-07-04T17:08:52Z,2018-07-04T17:08:52Z,MEMBER,"We have `xarray.Variable.set_dims`, but that's only in the low-level variable API.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,338226520 https://github.com/pydata/xarray/issues/2267#issuecomment-402528134,https://api.github.com/repos/pydata/xarray/issues/2267,402528134,MDEyOklzc3VlQ29tbWVudDQwMjUyODEzNA==,1200058,2018-07-04T17:06:51Z,2018-07-04T17:06:51Z,NONE,@shoyer so there is no direct xarray equivalent to np.broadcast_to?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,338226520 https://github.com/pydata/xarray/issues/2267#issuecomment-402527242,https://api.github.com/repos/pydata/xarray/issues/2267,402527242,MDEyOklzc3VlQ29tbWVudDQwMjUyNzI0Mg==,1217238,2018-07-04T17:00:39Z,2018-07-04T17:00:39Z,MEMBER,"We could add an optional `size` argument to `expand_dims`, with a default value of 1.","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,338226520 https://github.com/pydata/xarray/issues/2267#issuecomment-402524911,https://api.github.com/repos/pydata/xarray/issues/2267,402524911,MDEyOklzc3VlQ29tbWVudDQwMjUyNDkxMQ==,1200058,2018-07-04T16:45:39Z,2018-07-04T16:45:39Z,NONE,"As an explanation: I'd like to change my program to only use lazy / chunked calculations in order to save RAM. I recognized that np.broadcast_to converts the DataArray into a numpy one. Therefore I needed some xarray way to solve this. I tried: ```python DataArray.expand_dims(""new_dim"").isel(""new_dim"", np.repeat(0, target_dim_size)) ``` but this really looks ugly and I'm not sure about the performance implications of this.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,338226520 https://github.com/pydata/xarray/issues/2267#issuecomment-402459865,https://api.github.com/repos/pydata/xarray/issues/2267,402459865,MDEyOklzc3VlQ29tbWVudDQwMjQ1OTg2NQ==,1200058,2018-07-04T12:07:49Z,2018-07-04T12:18:54Z,NONE,"No, I'd need something like np.tile. expand_dims inserts only a dimension of length '1'","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,338226520 https://github.com/pydata/xarray/issues/2267#issuecomment-402456056,https://api.github.com/repos/pydata/xarray/issues/2267,402456056,MDEyOklzc3VlQ29tbWVudDQwMjQ1NjA1Ng==,10050469,2018-07-04T11:51:24Z,2018-07-04T11:51:24Z,MEMBER,Is [exand dims](http://xarray.pydata.org/en/stable/generated/xarray.DataArray.expand_dims.html) not what you are looking for?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,338226520