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/3343#issuecomment-535969947,https://api.github.com/repos/pydata/xarray/issues/3343,535969947,MDEyOklzc3VlQ29tbWVudDUzNTk2OTk0Nw==,2448579,2019-09-27T14:44:17Z,2019-09-27T14:44:17Z,MEMBER,"More generally, this is about applying operations with non dimensional coordinates which need not be 1D. Thinking about API, how about adding a `coord` kwarg? `da.differentiate(dim=""nx"", coord=""x"")` This says use `np.diff` on `da` along dimension `nx` and divide by spacing calculated by `np.diff` on `da.x` along dimension `nx` If `x` is 1D, then `da.differentiate(coord=""x"")` is equivalent to `da.differentiate(dim=""nx"", coord=""x"")` which is your proposal. i think this is cleaner and more explicit than automatically mapping 1D nondimensional coords to dimensions. ","{""total_count"": 2, ""+1"": 2, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,498297720 https://github.com/pydata/xarray/issues/3343#issuecomment-535475540,https://api.github.com/repos/pydata/xarray/issues/3343,535475540,MDEyOklzc3VlQ29tbWVudDUzNTQ3NTU0MA==,35968931,2019-09-26T12:15:44Z,2019-09-26T12:15:44Z,MEMBER,"This is an example of a general UI problem which I was actually about to raise an issue about. There are loads of places in xarray's API which require a dimension, but the operation would make just as much sense if a 1D coordinate were supplied instead (as that uniquely specifies a dimension). I encountered the same kind of problem in #3334 with `da.transpose()`. I wonder if it would be possible to have a little helper function process the `dim` input to these functions and if it's a 1D coord, just demote it to the corresponding dim. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,498297720 https://github.com/pydata/xarray/issues/3343#issuecomment-535036214,https://api.github.com/repos/pydata/xarray/issues/3343,535036214,MDEyOklzc3VlQ29tbWVudDUzNTAzNjIxNA==,14808389,2019-09-25T13:57:41Z,2019-09-25T13:57:41Z,MEMBER,"you might be able to achieve what you want by using [`swap_dims`](https://xarray.pydata.org/en/latest/generated/xarray.DataArray.swap_dims.html): ```python da.swap_dims({""dim"": ""nondim""}).interp(nondim=.5) ```","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,498297720