You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/12/18 05:45:33 UTC

[GitHub] marfago opened a new issue #9117: argsort produces an ndarray which cannot be used for indexing an ndarray

marfago opened a new issue #9117: argsort produces an ndarray which cannot be used for indexing an ndarray
URL: https://github.com/apache/incubator-mxnet/issues/9117
 
 
   The following snippet 
   ``` X[nd.argsort(X,axis=1)] = 0 ```
   
   gives
   
   ```
   ValueError: NDArray does not support slicing with key 
   [[  1.   2.   4. ...,  45.  14.  22.]
    [  0.   1.   2. ...,  46.   5.  22.]
    [  0.   1.   7. ...,   5.   4.  46.]
    ..., 
    [  1.   4.   7. ...,  26.   9.   6.]
    [  0.   1.   2. ...,  36.  45.  22.]
    [  0.   1.   5. ...,  20.  13.  14.]]
   <NDArray 64x50 @cpu(0)> of type <class 'mxnet.ndarray.ndarray.NDArray'>.
   ```
   
   I think that argsort result should be ready to be used as index for matrices with no further conversion.
   Please also note that argsort returns a NDAarray of double and not of int as one would expect for indexes.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services