Indexing multidimensional arrays
Generalised indexing
- Using square brackets to index multidimensional array:
X[<Indeces>]
; - Indeces:
Index[,Index]+
; - Index:
{number|array|slice|mask|names}
; - Advanced indexing operatos similar to Pandas. E.g.
.where
,.isin
,.query
. - Attaching an index (flat or hierarchical) to a dimention;
- Backends: Numpy, Pandas, H5Py
Numpy
- Indexing with a single element;
- Lists and arrays;
- Slising and striding, negative indexing;
- Structural indexing tools (np.newaxis, ellipsis);
- Broadcasting:
When operating on two arrays, NumPy compares their shapes element-wise. It starts with the trailing (i.e. rightmost) dimensions and works its way left
- Advanced indexing;
- Masked arrays;
- Array manipulation routines;
References
Pandas
- Using standard brackets
[...]
; - Dot (.) operator (
.loc
,.iloc
,.at
,.iat
); - Direct attribute access by name;
- Reindexing;
- Setting with enlargement;
- Additional methods:
.where
,.isin
,.query
; - Hierarchical indexing with levels;
- Multi-index cross casting:
.form_product
,.from_frame
,.from_tuples
etc.; - Timeseries support.
References
RLang
- Differentiation between vectors, matrices, lists and data frames;
- Dollar sign operator -
$
; - Slicing and striding support, masks, negative indexing.
- Extended operators:
which
,%in%
,match
.
References
PyTorch
- Similar to Numpy