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/1053#issuecomment-290951551,https://api.github.com/repos/pydata/xarray/issues/1053,290951551,MDEyOklzc3VlQ29tbWVudDI5MDk1MTU1MQ==,1117703,2017-04-01T22:34:12Z,2017-04-01T23:29:31Z,NONE,"First let me say, I know python, but I don't know linear algebra (I rely on @kkloste for algebra). I'm also new to `xarray` and recently used it for the [first time](https://github.com/greenelab/hetmech/blob/e15d6b80e99df3e42a8e054a8b317db3e47959f0/2.xarray.ipynb) to represent a hetnet (network with multiple node and relationship types) as a `xarray.DataSet` where each `DataArray` is an adjacency matrix (`0` or `1` for whether an edge exists) for a specific edge type. I was drawn to `xarray` because it allows us to:
1. assign row/column labels (representing node identity) to 2D arrays (adjacency matrixes in our case)
2. reason across multiple adjacency matrixes by assigning dimension identities (node types)
The operations that we're using for our project are dot-product multiplying 2D arrays by 2D arrays and 1D arrays by 2D arrays. Currently, our arrays are `numpy.ndarray`s, but we may switch some of our 2D arrays to `scipy.sparse` matrices.
> I'm intrigued, but how would this work? data_array + numpy_array yields a result with well-defined labels as long as numpy_array broadcasts against data_array.data, but data_array @ numpy_array does not if numpy_array has 2 or more dimensions.
My intuition was that we use `@` on a DataArray in cases where `DataArray.values @ numpy.ndarray` or `numpy.ndarray @ DataArray.values` would work. In these situations, the user would be responsible for ensuring `numpy.ndarray` had the correct coordinates and dimensions. We're also interested in `DataArray.values @ scipy.sparse`.
However, it appears that `xarray` may do some inference based aligning dimensions/coordinates... and that I need to understand this process a bit more. Sorry if this reply doesn't help you move forward with this issue. I hopefully will be able to be more helpful as I become more familiar with `xarray`.
> It also gets messy on Dataset objects
For clarity, I wasn't thinking of using `@` on Datasets.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,184238633
https://github.com/pydata/xarray/issues/1053#issuecomment-290940281,https://api.github.com/repos/pydata/xarray/issues/1053,290940281,MDEyOklzc3VlQ29tbWVudDI5MDk0MDI4MQ==,1117703,2017-04-01T19:01:57Z,2017-04-01T19:01:57Z,NONE,"More specifically, I'd like to be able to do matrix multiplication between numpy ndarrays / matrices, scipy sparse matrices, and xarray DataArrays. `@` seems like the most natural operator to enable this cross-package compatibility.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,184238633
https://github.com/pydata/xarray/issues/1053#issuecomment-290939565,https://api.github.com/repos/pydata/xarray/issues/1053,290939565,MDEyOklzc3VlQ29tbWVudDI5MDkzOTU2NQ==,1117703,2017-04-01T18:49:50Z,2017-04-01T18:49:50Z,NONE,"Would love support for [PEP 465](http://legacy.python.org/dev/peps/pep-0465/) `@` notation.
Recently, `@` [came in handy](https://github.com/greenelab/hetmech/issues/13#issuecomment-290780424) when multiplying `numpy.ndarray` with `scipy.sparse` matrices. We're [considering](https://github.com/greenelab/hetmech/issues/12) `xarray` for our project and compatibility with this unified operator would be a real plus!","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,184238633