No problems:
>>> t = np.array([[1,1,1,1,1],[2,2,2,2,2],[3,3,3,3,3],[4,4,4,4,4],[5,5,5,5,5]]) >>> x = np.arange(5).reshape((-1,1)); y = np.arange(5) >>> print (t[[x]],t[[y]])
A big problem:
>>> s = scipy.sparse.csr_matrix(t) >>> print (s[[x]].toarray(),s[[y]].toarray()) Traceback (most recent call last): File "<pyshell#22>", line 1, in <module> : : : : ValueError: data, indices, and indptr should be rank 1
s.toarray()[[x]] works fine, but it hits the whole target with sparse matrices, since my arrays are too large. I checked the attributes and methods associated with some sparse matrices, for anything referring to Advanced Indexing, but without cubes. Any ideas?
Noob saibot
source share