JuliaLang/julia

Ellipsis slicing

Open

#5405 aperta il 15 gen 2014

Vedi su GitHub
 (29 commenti) (8 reazioni) (0 assegnatari)Julia (5773 fork)batch import
arrayshelp wantedparser

Metriche repository

Star
 (48.709 star)
Metriche merge PR
 (Merge medio 20g 6h) (157 PR mergiate in 30 g)

Descrizione

Numpy has this ellipsis notation for filling index tuples up to dimension, where in A[..., i, k] ... is interpreted as shorthand for the number of colons :, :, : etc needed to fill the indexing tuple up to dimension n.

http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html

This gives nice access to contiguous subarrays in the dense array case and would be not more harmful than the : notation itself.

Was this feature already considered? It was mentioned by @toivoh on the mailing list, but did not trigger discussion.

Guida contributor